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

:root {
    --primary-purple: #1a0a2e;
    --secondary-purple: #2d1b4e;
    --dark-purple: #0a0a1a;
    --accent-orange: #ff6b35;
    --text-light: #e0e0e0;
    --text-muted: #b0b0b0;
    --error-red: #ff4444;
    --success-green: #4caf50;
    --input-bg: rgba(45, 27, 78, 0.3);
    --input-border: rgba(255, 107, 53, 0.3);
    --input-focus-border: rgba(255, 107, 53, 0.8);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--dark-purple) 50%, var(--secondary-purple) 100%);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.6;
    padding: 20px;
}

/* Container */
.auth-container {
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Logo Link Hover Effect */
.auth-box a[href="/"]:hover {
    opacity: 0.8;
}

/* Auth Box */
.auth-box {
    background: linear-gradient(135deg, rgba(45, 27, 78, 0.6) 0%, rgba(26, 10, 46, 0.4) 100%);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 16px;
    padding: 50px 40px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.auth-box h1 {
    font-size: 32px;
    color: #fff;
    margin-bottom: 10px;
    font-weight: 700;
    text-align: center;
}

.subtitle {
    font-size: 16px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 30px;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

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

.form-input:focus {
    border-color: var(--input-focus-border);
    background: rgba(45, 27, 78, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-input:invalid:not(:placeholder-shown) {
    border-color: var(--error-red);
}

/* Code input styling */
.code-input {
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Input with buttons */
.input-with-buttons {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-with-buttons .form-input {
    flex: 1;
}

.button-group {
    display: flex;
    gap: 6px;
}

/* Icon buttons */
.btn-icon {
    padding: 12px;
    background: rgba(255, 107, 53, 0.15);
    border: 2px solid var(--input-border);
    border-radius: 8px;
    color: var(--accent-orange);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
}

.btn-icon:hover {
    background: rgba(255, 107, 53, 0.25);
    border-color: var(--accent-orange);
    transform: translateY(-2px);
}

.btn-icon:active {
    transform: translateY(0);
}

.btn-icon svg {
    display: block;
}

/* Primary button */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--accent-orange);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    background: #ff8555;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

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

.btn-primary:disabled {
    background: #ff8555;
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

/* Link button (styled as link but button element) */
.btn-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}

/* Error message */
.error-message {
    font-size: 13px;
    color: var(--error-red);
    min-height: 18px;
    display: block;
}

.error-message:empty {
    display: none;
}

/* Auth links */
.auth-links {
    margin-top: 30px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.resend-timer {
    color: var(--accent-orange);
    font-weight: 500;
    font-size: 14px;
}

.separator {
    color: var(--text-muted);
    opacity: 0.5;
}

.link-primary {
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.link-primary:hover {
    color: #ff8555;
    text-decoration: underline;
}

.link-secondary {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.link-secondary:hover {
    color: var(--text-light);
    text-decoration: underline;
}

/* Toast notification - unified with app/css/components/toast.css */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-green);
    color: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(400px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    z-index: 100002;
    max-width: 350px;
    word-wrap: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive */
@media (max-width: 768px) {
    .toast {
        right: 10px;
        top: 10px;
        left: 10px;
        max-width: 100%;
        font-size: 13px;
        padding: 12px 18px;
        transform: translateY(-100px);
    }

    .toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .auth-box {
        padding: 40px 30px;
    }

    .auth-box h1 {
        font-size: 28px;
    }

    .subtitle {
        font-size: 14px;
    }

    .form-input {
        padding: 12px 16px;
        font-size: 14px;
    }

    .code-input {
        font-size: 20px;
        letter-spacing: 6px;
    }

    .btn-primary {
        padding: 14px;
        font-size: 15px;
    }

    .btn-icon {
        min-width: 44px;
        padding: 10px;
    }

    .auth-links {
        font-size: 13px;
    }
}

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

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--accent-orange);
    outline-offset: 2px;
}
