* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --bg-dark: #0a0a0f;
    --bg-card: #111118;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: #27272a;
    --error: #ef4444;
    --success: #22c55e;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.auth-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    top: -200px;
    right: -200px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    bottom: -100px;
    left: -100px;
}

.auth-card {
    position: relative;
    z-index: 1;
    background: rgba(17, 17, 24, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    margin-bottom: 2rem;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.phone-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.country-select {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    min-width: 90px;
}

.country-select:focus {
    outline: none;
    border-color: var(--primary);
}

input[type="tel"],
input[type="text"] {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

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

.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.otp-inputs {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.otp-input {
    width: 64px;
    height: 72px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

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

.btn-block {
    width: 100%;
}

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

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

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

.spinner {
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    text-align: center;
}

.error-message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.resend-section {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

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

.auth-footer {
    margin-top: 2rem;
    text-align: center;
}

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

.auth-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.auth-footer a:hover {
    color: var(--primary);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
}

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

/* Wide card for registration */
.auth-card-wide {
    max-width: 480px;
}

/* Account type toggle */
.account-type-toggle {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
}

.toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn:hover {
    color: var(--text-primary);
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
}

.toggle-btn svg {
    flex-shrink: 0;
}

/* Form row for side-by-side inputs */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Email input styling */
input[type="email"],
input[type="password"] {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
    width: 100%;
}

/* Password input wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--text-secondary);
}

/* Password requirements */
.password-requirements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.requirement .check-icon {
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.requirement.valid {
    color: var(--success);
}

.requirement.valid .check-icon {
    background: var(--success);
    border-color: var(--success);
}

.requirement.valid .check-icon::after {
    content: '';
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg);
    margin-bottom: 2px;
}

.checkbox-text {
    color: var(--text-secondary);
    line-height: 1.5;
}

.checkbox-text a {
    color: var(--primary-light);
    text-decoration: none;
}

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

/* Verify email page styles */
.verify-email-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.verify-email-icon svg {
    color: var(--primary);
}

.auth-header.text-center {
    text-align: center;
}

.email-display {
    color: var(--primary-light);
    font-weight: 500;
    margin-top: 0.25rem;
    word-break: break-all;
}

.verify-instructions {
    text-align: center;
    margin-bottom: 1.5rem;
}

.verify-instructions p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.verify-instructions .link-expiry {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Error message link styling */
.error-message a {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    color: var(--text-muted);
}

.step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step.completed .step-number::after {
    content: '';
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.step.active .step-label {
    color: var(--text-primary);
}

.step.completed .step-label {
    color: var(--success);
}

.step-line {
    width: 60px;
    height: 2px;
    background: var(--border);
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
}

.step-line.completed {
    background: var(--success);
}

/* Skip Link */
.skip-link {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.skip-link:hover {
    color: var(--primary);
}

.skip-note {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 5-digit OTP inputs */
.otp-inputs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.otp-input {
    width: 56px;
    height: 64px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }

    .otp-input {
        width: 56px;
        height: 64px;
        font-size: 1.25rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .password-requirements {
        grid-template-columns: 1fr;
    }

    .account-type-toggle {
        flex-direction: column;
    }
}
