/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Poppins', 'SF Pro', system-ui, sans-serif;
    width: 1440px;
    height: 900px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    color: #E8EEF5;
}

/* Background */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('night-sky-stars.svg') center center / cover no-repeat;
    /* Fallback gradient if image doesn't load */
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 200, 255, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #0c0c1e 0%, #1a1a2e 50%, #16213e 100%);
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 10, 25, 0.65);
    mix-blend-mode: multiply;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    position: relative;
    z-index: 10;
}

.back-link {
    color: #8FA4C9;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 160ms ease;
}

.back-link:hover {
    color: #FFFFFF;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo {
    width: 36px;
    height: 36px;
    background: #2962FF;
    color: #FFFFFF;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
}

.signup-button {
    background: #0B0D15;
    color: #FFFFFF;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 160ms ease;
    font-family: inherit;
}

.signup-button:hover {
    background: #1a1d2e;
    transform: translateY(-1px);
}

/* Main content */
.main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 96px);
    padding: 0 32px;
    flex-direction: column;
}

/* Auth card */
.auth-card {
    width: 100%;
    max-width: 380px;
    opacity: 0;
    transform: translateY(20px);
    animation: cardEntrance 500ms ease-out 200ms forwards;
}

/* Form */
.auth-form {
    width: 100%;
}

.field-group {
    margin-bottom: 14px;
}

.field-container {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 14px;
    z-index: 2;
    color: rgba(232, 238, 245, 0.6);
    pointer-events: none;
    transition: color 160ms ease;
}

.form-field {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 46px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    color: #E8EEF5;
    font-size: 14px;
    font-family: inherit;
    transition: all 160ms ease;
    outline: none;
}

.form-field::placeholder {
    color: rgba(232, 238, 245, 0.6);
}

.form-field:focus {
    border-color: rgba(41, 98, 255, 0.8);
    box-shadow: 0 0 0 2px rgba(41, 98, 255, 0.6);
}

.form-field:focus + .field-icon,
.field-container:focus-within .field-icon {
    color: #2962FF;
}

/* Fix for autofill and pasted content - prevent white background */
.form-field:-webkit-autofill,
.form-field:-webkit-autofill:hover,
.form-field:-webkit-autofill:focus,
.form-field:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px transparent inset !important;
    -webkit-text-fill-color: #E8EEF5 !important;
    background: transparent !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Fix for fields with values (not placeholder) */
.form-field:not(:placeholder-shown) {
    background: transparent !important;
    color: #E8EEF5 !important;
}

/* Fix for autofill in Firefox */
.form-field:-moz-autofill {
    background: transparent !important;
    color: #E8EEF5 !important;
}

/* Form options row */
.form-options {
    display: flex;
    justify-content: center !important;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 18px;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 14px;
    width: 14px;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    margin-right: 8px;
    position: relative;
    transition: all 160ms ease;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #2962FF;
    border-color: #2962FF;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 4px;
    top: 1px;
    width: 3px;
    height: 6px;
    border: solid #FFFFFF;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
    outline: none;
}

.checkbox-label {
    color: rgba(232, 238, 245, 0.7);
    font-size: 14px;
    font-weight: 500;
}

/* Primary button */
.primary-button {
    width: 120px;
    height: 42px;
    background: #2962FF;
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(41, 98, 255, 0.4);
    transition: all 140ms ease;
    position: relative;
    overflow: hidden;
    outline: none;
}

.primary-button:hover {
    background: #3D75FF;
    transform: scale(1.04);
    box-shadow: 0 6px 16px rgba(41, 98, 255, 0.5);
}

.primary-button:active {
    background: #1E4CE0;
    transform: scale(1.02);
}

.primary-button:focus {
    box-shadow: 
        0 4px 12px rgba(41, 98, 255, 0.4),
        0 0 0 2px rgba(41, 98, 255, 0.6);
}

/* Forgot password */
.forgot-password {
    text-align: center;
    margin-top: 18px;
}

.forgot-link {
    color: #8FA4C9;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 160ms ease;
}

.forgot-link:hover {
    color: #FFFFFF;
}

/* Animations */
@keyframes cardEntrance {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus ring animation */
.form-field:focus {
    animation: focusRing 160ms ease-out;
}

@keyframes focusRing {
    from {
        box-shadow: 0 0 0 0 rgba(41, 98, 255, 0.6);
    }
    to {
        box-shadow: 0 0 0 2px rgba(41, 98, 255, 0.6);
    }
}

/* Button hover animation */
.primary-button:hover {
    animation: buttonHover 140ms ease-out;
}

@keyframes buttonHover {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.04);
    }
}

/* Accessibility */
.form-field:focus,
.primary-button:focus,
.back-link:focus,
.forgot-link:focus,
.signup-button:focus {
    outline: 2px solid rgba(41, 98, 255, 0.6);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-field {
        border-width: 2px;
        background: rgba(0, 0, 0, 0.3);
    }
    
    .primary-button {
        border: 2px solid #FFFFFF;
    }
    
    .checkmark {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .auth-card {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

/* Responsive adjustments */
@media (max-width: 1440px) {
    body {
        width: 100vw;
        max-width: 1440px;
    }
}

@media (max-height: 900px) {
    body {
        height: 100vh;
        max-height: 900px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 16px 20px;
    }
    
    .main {
        padding: 0 20px;
    }
    
    .auth-card {
        max-width: 100%;
    }
    
    .form-options {
        flex-direction: column;
        align-items: center !important;
        justify-content: center !important;
        gap: 16px;
    }
    
    .primary-button {
        width: 100%;
    }
}

.form-title {
    margin-bottom: 10px;
    text-align: center !important;
}
