/* FxClick Insight - Premium Auth UI */
/* Inspired by: Stripe, Linear, Vercel */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Premium Color Palette */
    --bg-dark: #050505;
    --bg-card: #0a0a0a;
    --bg-elevated: #111111;
    --bg-input: #0d0d0d;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.15);

    --text-primary: #fafafa;
    --text-secondary: #888888;
    --text-tertiary: #555555;

    /* Accent - Emerald/Teal */
    --accent: #10b981;
    --accent-light: #34d399;
    --accent-glow: rgba(16, 185, 129, 0.15);
    --accent-border: rgba(16, 185, 129, 0.4);

    /* Status Colors */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --success-border: rgba(34, 197, 94, 0.3);

    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --error-border: rgba(239, 68, 68, 0.3);

    --warning: #eab308;
    --warning-bg: rgba(234, 179, 8, 0.1);

    /* Gradients */
    --gradient-glow: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 0%), rgba(16, 185, 129, 0.06), transparent 40%);
    --gradient-border: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Background Effects */
.auth-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.auth-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 50%, rgba(6, 182, 212, 0.08), transparent),
        radial-gradient(ellipse 50% 30% at 20% 80%, rgba(139, 92, 246, 0.05), transparent);
    animation: bgPulse 20s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(-2%, 2%) rotate(1deg);
    }
}

/* Grid pattern overlay */
.auth-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black, transparent);
}

/* Main Container */
.auth-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* Auth Card */
.auth-card {
    width: 100%;
    max-width: 420px;
    animation: cardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
}

.logo-mark {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent) 0%, #06b6d4 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: white;
    box-shadow:
        0 0 20px rgba(16, 185, 129, 0.3),
        0 0 60px rgba(16, 185, 129, 0.1);
    position: relative;
}

.logo-mark::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    border-radius: 13px;
    z-index: -1;
    opacity: 0.5;
    filter: blur(8px);
}

.logo-text {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-text span {
    background: linear-gradient(135deg, var(--accent-light), #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    background: linear-gradient(to bottom, #ffffff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* Form Container */
.auth-form-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.auth-form-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-glow);
    pointer-events: none;
}

/* Form */
.auth-form {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-group label .required {
    color: var(--error);
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
}

/* Inputs */
.form-group input,
.form-group select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--border-hover);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Validation States */
.form-group input.valid {
    border-color: var(--success);
    background: var(--success-bg);
}

.form-group input.valid:focus {
    box-shadow: 0 0 0 3px var(--success-bg);
}

.form-group input.invalid {
    border-color: var(--error);
    background: var(--error-bg);
}

.form-group input.invalid:focus {
    box-shadow: 0 0 0 3px var(--error-bg);
}

.form-group input.checking {
    border-color: var(--warning);
}

/* Validation Icon */
.input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.2s ease;
}

.input-icon.show {
    opacity: 1;
}

.input-icon.valid {
    background: var(--success);
    color: white;
}

.input-icon.invalid {
    background: var(--error);
    color: white;
}

.input-icon.checking {
    background: var(--warning);
    color: #000;
    animation: iconPulse 1s ease infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: translateY(-50%) scale(1);
    }

    50% {
        transform: translateY(-50%) scale(1.1);
    }
}

/* Validation Message */
.input-message {
    font-size: 0.75rem;
    font-weight: 500;
    min-height: 18px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-message.valid {
    color: var(--success);
}

.input-message.invalid {
    color: var(--error);
}

.input-message.checking {
    color: var(--warning);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.password-toggle:hover {
    background: var(--border-subtle);
    color: var(--text-secondary);
}

.form-group input.has-toggle {
    padding-right: 52px;
}

.form-group input.has-icon {
    padding-right: 48px;
}

/* Password Strength */
.password-meter {
    margin-top: 8px;
}

.meter-bar {
    height: 3px;
    background: var(--border-default);
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    gap: 3px;
}

.meter-segment {
    flex: 1;
    height: 100%;
    background: var(--border-default);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.meter-segment.active.weak {
    background: var(--error);
}

.meter-segment.active.fair {
    background: #f97316;
}

.meter-segment.active.good {
    background: var(--warning);
}

.meter-segment.active.strong {
    background: var(--success);
}

.meter-text {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.meter-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meter-label.weak {
    color: var(--error);
}

.meter-label.fair {
    color: #f97316;
}

.meter-label.good {
    color: var(--warning);
}

.meter-label.strong {
    color: var(--success);
}

/* Checkbox */
.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.checkbox-box {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.checkbox-field input {
    display: none;
}

.checkbox-field input:checked+.checkbox-box {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-field input:checked+.checkbox-box::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.checkbox-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.checkbox-label a {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 500;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Remember Me */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-check label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Submit Button */
.btn {
    height: 48px;
    padding: 0 24px;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #059669 100%);
    color: white;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.1),
        0 0 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 0 30px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn-primary:hover::before {
    transform: translateX(100%);
}

.btn-block {
    width: 100%;
}

.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-loading .btn-text {
    display: none;
}

.btn-loading .btn-spinner {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.875rem;
}

.alert-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-content ul {
    margin: 0;
    padding-left: 16px;
}

.alert-content li {
    margin: 2px 0;
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: #fca5a5;
}

.alert-error .alert-icon {
    background: var(--error);
    color: white;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: #86efac;
}

.alert-success .alert-icon {
    background: var(--success);
    color: white;
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 28px;
}

.auth-footer p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Pending Info */
.pending-info {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
}

.pending-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.pending-info ul {
    list-style: none;
    padding: 0;
}

.pending-info li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 10px 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.pending-info li::before {
    content: '→';
    color: var(--accent);
    font-weight: 600;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.divider span {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-container {
        padding: 24px 16px;
    }

    .auth-form-container {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }
}

/* Focus visible */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--accent);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}