/* ============================================
   POLYTRADE AUTHENTICATION PAGES STYLES
   Modern dark theme with glassmorphism
   ============================================ */

/* ============================================
   CSS VARIABLES (inheriting from landing.css)
   ============================================ */
:root {
    /* Colors */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #1c2128;
    --bg-card: rgba(22, 27, 34, 0.8);
    --bg-glass: rgba(22, 27, 34, 0.6);

    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;

    --accent-blue: #58a6ff;
    --accent-purple: #a371f7;
    --accent-green: #3fb950;
    --accent-red: #f85149;
    --accent-yellow: #d29922;

    --border-color: rgba(48, 54, 61, 0.8);
    --border-glass: rgba(255, 255, 255, 0.1);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #58a6ff 0%, #a371f7 100%);
    --gradient-secondary: linear-gradient(135deg, #a371f7 0%, #3fb950 100%);
    --gradient-glow: linear-gradient(135deg, rgba(88, 166, 255, 0.3) 0%, rgba(163, 113, 247, 0.3) 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 40px rgba(88, 166, 255, 0.3);
    --shadow-glow-purple: 0 0 40px rgba(163, 113, 247, 0.3);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Font */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(88, 166, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88, 166, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150%;
    height: 60%;
    background: radial-gradient(ellipse at center top, rgba(88, 166, 255, 0.1) 0%, rgba(163, 113, 247, 0.05) 30%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-purple);
}

/* ============================================
   AUTH CONTAINER
   ============================================ */
.auth-container {
    width: 100%;
    max-width: 440px;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   AUTH CARD
   ============================================ */
.auth-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.auth-card:hover {
    box-shadow: var(--shadow-lg), 0 0 60px rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.3);
}

/* ============================================
   AUTH HEADER
   ============================================ */
.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.auth-logo:hover {
    color: var(--text-primary);
}

.auth-logo i {
    color: var(--accent-blue);
    font-size: 2rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ============================================
   FORM STYLES
   ============================================ */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-label .optional {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-family);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:hover {
    border-color: rgba(88, 166, 255, 0.4);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.15);
    background: var(--bg-primary);
}

.form-input.error {
    border-color: var(--accent-red);
}

.form-input.error:focus {
    box-shadow: 0 0 0 4px rgba(248, 81, 73, 0.15);
}

.form-input.success {
    border-color: var(--accent-green);
}

/* Input with icon */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .form-input {
    padding-right: 48px;
}

.input-icon {
    position: absolute;
    right: 16px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.input-icon:hover {
    color: var(--accent-blue);
}

.input-icon.toggle-password {
    cursor: pointer;
}

/* Field error message */
.field-error {
    font-size: 0.75rem;
    color: var(--accent-red);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    animation: fadeIn 0.2s ease;
}

.field-error i {
    font-size: 0.875rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   PASSWORD STRENGTH METER
   ============================================ */
.password-strength {
    margin-top: var(--space-sm);
}

.strength-meter {
    height: 4px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

.strength-bar {
    height: 100%;
    width: 0;
    border-radius: var(--radius-full);
    transition: width var(--transition-base), background-color var(--transition-base);
}

.strength-bar.weak {
    width: 25%;
    background: var(--accent-red);
}

.strength-bar.fair {
    width: 50%;
    background: var(--accent-yellow);
}

.strength-bar.good {
    width: 75%;
    background: var(--accent-blue);
}

.strength-bar.strong {
    width: 100%;
    background: var(--accent-green);
}

.strength-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.strength-label {
    font-weight: 500;
}

.strength-label.weak { color: var(--accent-red); }
.strength-label.fair { color: var(--accent-yellow); }
.strength-label.good { color: var(--accent-blue); }
.strength-label.strong { color: var(--accent-green); }

/* Password requirements */
.password-requirements {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.requirements-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.requirement {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    transition: color var(--transition-fast);
}

.requirement:last-child {
    margin-bottom: 0;
}

.requirement i {
    font-size: 0.75rem;
    width: 16px;
    text-align: center;
}

.requirement.met {
    color: var(--accent-green);
}

.requirement.met i {
    color: var(--accent-green);
}

/* ============================================
   CHECKBOX STYLES
   ============================================ */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.checkbox-input {
    display: none;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.checkbox-custom i {
    font-size: 0.75rem;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-fast);
}

.checkbox-input:checked + .checkbox-label .checkbox-custom {
    background: var(--gradient-primary);
    border-color: transparent;
}

.checkbox-input:checked + .checkbox-label .checkbox-custom i {
    opacity: 1;
    transform: scale(1);
}

.checkbox-input:focus + .checkbox-label .checkbox-custom {
    box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.15);
}

.checkbox-text {
    line-height: 1.4;
}

.checkbox-text a {
    color: var(--accent-blue);
}

.checkbox-text a:hover {
    text-decoration: underline;
}

/* Remember me row */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--accent-blue);
}

.forgot-link:hover {
    text-decoration: underline;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 24px;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-block {
    width: 100%;
}

/* Button loading state */
.btn.loading {
    pointer-events: none;
}

.btn.loading .btn-text {
    opacity: 0.7;
}

.btn .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn.loading .spinner {
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button success state */
.btn.success {
    background: linear-gradient(135deg, var(--accent-green) 0%, #238636 100%);
}

/* ============================================
   DIVIDER
   ============================================ */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   SOCIAL BUTTONS
   ============================================ */
.social-buttons {
    display: flex;
    gap: var(--space-md);
}

.btn-social {
    flex: 1;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-social:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

/* ============================================
   ALERT MESSAGES
   ============================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    animation: fadeIn 0.3s ease;
}

.alert-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: var(--space-xs);
}

.alert-text {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Alert variants */
.alert-error {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.alert-error .alert-icon,
.alert-error .alert-title {
    color: var(--accent-red);
}

.alert-success {
    background: rgba(63, 185, 80, 0.1);
    border: 1px solid rgba(63, 185, 80, 0.3);
}

.alert-success .alert-icon,
.alert-success .alert-title {
    color: var(--accent-green);
}

.alert-info {
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
}

.alert-info .alert-icon,
.alert-info .alert-title {
    color: var(--accent-blue);
}

.alert-warning {
    background: rgba(210, 153, 34, 0.1);
    border: 1px solid rgba(210, 153, 34, 0.3);
}

.alert-warning .alert-icon,
.alert-warning .alert-title {
    color: var(--accent-yellow);
}

/* ============================================
   AUTH FOOTER
   ============================================ */
.auth-footer {
    text-align: center;
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.auth-footer a {
    font-weight: 500;
}

/* ============================================
   BACK LINK
   ============================================ */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--accent-blue);
}

.back-link i {
    font-size: 0.75rem;
}

/* ============================================
   VERIFICATION STATUS
   ============================================ */
.verification-status {
    text-align: center;
    padding: var(--space-xl);
}

.status-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.status-icon.success {
    background: rgba(63, 185, 80, 0.1);
    color: var(--accent-green);
    border: 2px solid rgba(63, 185, 80, 0.3);
}

.status-icon.error {
    background: rgba(248, 81, 73, 0.1);
    color: var(--accent-red);
    border: 2px solid rgba(248, 81, 73, 0.3);
}

.status-icon.pending {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-blue);
    border: 2px solid rgba(88, 166, 255, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(88, 166, 255, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(88, 166, 255, 0); }
}

.status-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.status-text {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

/* ============================================
   RESEND VERIFICATION
   ============================================ */
.resend-section {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.resend-section p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    transition: color var(--transition-fast);
}

.btn-link:hover {
    color: var(--accent-purple);
    text-decoration: underline;
}

.btn-link:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.countdown {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 480px) {
    body {
        padding: var(--space-md);
    }

    .auth-card {
        padding: var(--space-lg);
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .social-buttons {
        flex-direction: column;
    }

    .btn-social {
        flex: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible styles */
.form-input:focus-visible,
.btn:focus-visible,
.checkbox-input:focus-visible + .checkbox-label .checkbox-custom {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
