/**
 * Login Page Styles
 * PRD Section 10.4.2: Experimenter Login System
 * Happy Hues Palette 14 - Dark Futuristic Theme
 */

:root {
    /* Happy Hues Palette 14 - Dark Futuristic Colors */
    --color-background: #16161a;
    --color-headline: #fffffe;
    --color-paragraph: #94a1b2;
    --color-button: #7f5af0;
    --color-button-hover: #6b47d6;
    --color-button-text: #fffffe;

    /* Accent Colors */
    --color-stroke: rgba(255, 255, 254, 0.1);
    --color-highlight: #7f5af0;
    --color-secondary: #72757e;
    --color-tertiary: #2cb67d;

    /* Dark theme backgrounds */
    --bg-primary: #16161a;
    --bg-secondary: #242629;
    --bg-tertiary: #2e3035;
    --bg-card: #242629;

    /* Text colors for dark theme */
    --text-primary: #fffffe;
    --text-secondary: #94a1b2;
    --text-muted: #72757e;
    --text-light: #fffffe;

    --border-color: rgba(255, 255, 254, 0.1);
    --border-light: rgba(255, 255, 254, 0.08);
    --error-color: #ef4444;
    --success-color: #2cb67d;

    /* Animation Timing */
    --transition-fast: 150ms cubic-bezier(0.33, 1, 0.68, 1);
    --transition-medium: 250ms cubic-bezier(0.33, 1, 0.68, 1);
    --transition-slow: 350ms cubic-bezier(0.33, 1, 0.68, 1);

    /* Shadows - Dark Theme */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(127, 90, 240, 0.15);
}

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

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

/* Headings use Space Grotesk */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

/* Container */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

/* Background */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-tertiary) 50%, var(--bg-primary) 100%);
    z-index: -1;
}

.login-background::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(127, 90, 240, 0.12) 0%, transparent 70%);
    animation: floatOrb 20s ease-in-out infinite;
}

.login-background::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(44, 182, 125, 0.08) 0%, transparent 70%);
    animation: floatOrb 25s ease-in-out infinite reverse;
}

@keyframes floatOrb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(30px, -30px) scale(1.1);
    }
}

/* Back link */
.back-link {
    position: absolute;
    top: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.back-link:hover {
    color: var(--color-headline);
    background: rgba(127, 90, 240, 0.1);
}

.back-link svg {
    width: 18px;
    height: 18px;
}

/* Login Card */
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 254, 0.08);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Logo */
.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.logo-link {
    display: block;
    transition: transform var(--transition-medium), filter var(--transition-medium);
}

.logo-link:hover {
    transform: scale(1.02);
}

.carrier-logo-small {
    width: 180px;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(127, 90, 240, 0.2));
    transition: filter var(--transition-medium);
}

.logo-link:hover .carrier-logo-small {
    filter: drop-shadow(0 4px 15px rgba(127, 90, 240, 0.35));
}

/* Titles */
.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
}

/* Error message */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: var(--error-color);
    font-size: 0.9rem;
}

.error-message svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper svg {
    position: absolute;
    left: 1rem;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

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

.input-wrapper input:focus {
    outline: none;
    border-color: var(--color-highlight);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(127, 90, 240, 0.15);
}

.input-wrapper input:focus + svg,
.input-wrapper input:focus ~ svg {
    color: var(--color-headline);
}

/* Toggle password button */
.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password svg {
    position: static;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: auto;
    transition: color var(--transition-fast);
}

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

/* Form options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    border-radius: 5px;
    transition: all var(--transition-fast);
    position: relative;
}

.remember-me input:checked + .checkmark {
    background: var(--color-highlight);
    border-color: var(--color-highlight);
}

.remember-me input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid var(--color-headline);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.forgot-link:hover {
    color: var(--color-headline);
    text-decoration: underline;
}

/* Login button */
.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--color-button);
    color: var(--color-button-text);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid rgba(127, 90, 240, 0.5);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 0.5rem;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.login-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(127, 90, 240, 0.25);
    background: var(--color-button-hover);
}

.login-button:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: var(--shadow-sm);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-button .arrow-icon {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
}

.login-button:hover .arrow-icon {
    transform: translateX(3px);
}

/* Loader */
.button-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.spinner circle {
    stroke: var(--color-headline);
    stroke-dasharray: 50;
    stroke-dashoffset: 40;
    stroke-linecap: round;
}

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

/* Register prompt */
.register-prompt {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.register-prompt a {
    color: var(--color-highlight);
    text-decoration: none;
    font-weight: 500;
}

.register-prompt a:hover {
    text-decoration: underline;
}

/* Footer */
.login-footer {
    position: absolute;
    bottom: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
    }

    .back-link {
        top: 1rem;
        left: 1rem;
    }

    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}
