/* ========================================
   LOGIN PAGE - login.css
   Standalone styles for the login page.
   Uses CSS variables defined inline in login.html.
   ======================================== */

/* ========================================
   GLOBAL RESET FOR THIS PAGE
   ======================================== */

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: #ffffff;
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.2s ease;
}

a:hover {
    color: #0052a3;
}

/* ========================================
   PAGE WRAPPER — Two-column split layout
   ======================================== */

.login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   LEFT PANEL — Branded hero panel
   ======================================== */

.login-left {
    width: 480px;
    flex-shrink: 0;
    background: linear-gradient(160deg, #003d7a 0%, #0066cc 50%, #0080ff 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: relative;
    overflow: hidden;
}

/* Decorative background circles */
.login-left::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.login-left::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

/* ---- Brand Logo ---- */

.login-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    position: relative;
    z-index: 1;
}

.brand-logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.brand-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
}

.brand-sub {
    font-size: 0.58rem;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.35px;
    max-width: 185px;
}

/* ---- Hero Headline ---- */

.login-hero {
    position: relative;
    z-index: 1;
}

.hero-headline {
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.hero-subtext {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin: 0;
}

/* ---- Feature List ---- */

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
    position: relative;
    z-index: 1;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.feature-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
}

.feature-desc {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.4;
}

/* ---- Testimonial ---- */

.login-testimonial {
    margin-top: auto;
    padding: 1.25rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    z-index: 1;
}

.testimonial-quote {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-style: italic;
    margin-bottom: 1rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.testimonial-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.testimonial-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.testimonial-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
}

.testimonial-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   RIGHT PANEL — Login Form
   ======================================== */

.login-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background-color: #fafafa;
    position: relative;
}

/* ---- Login Card ---- */

.login-card {
    width: 100%;
    max-width: 420px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ---- Card Header ---- */

.login-card-header {
    margin-bottom: 2rem;
}

.login-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

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

/* ---- Alert ---- */

.login-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.login-alert.alert-error,
.login-alert.alert-danger {
    background-color: #fee2e2;
    border-left-color: var(--danger-color);
    color: var(--danger-color);
}

.login-alert.alert-success {
    background-color: #d1fae5;
    border-left-color: var(--success-color);
    color: var(--success-color);
}

/* ---- Form ---- */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Label row: label + forgot link side by side */
.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.label-row .form-label {
    margin-bottom: 0;
}

.forgot-link {
    font-size: 0.8375rem;
    color: var(--primary-color);
    font-weight: 500;
}

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

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

.input-icon {
    position: absolute;
    left: 0.875rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.login-input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text-primary);
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    line-height: 1.5;
}

.login-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.login-input::placeholder {
    color: #b0b0b0;
}

.login-input.input-error {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Password toggle button */
.toggle-password {
    position: absolute;
    right: 0.875rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    line-height: 1;
}

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

/* Field-level error */
.field-error {
    display: block;
    font-size: 0.8rem;
    color: var(--danger-color);
    margin-top: 0.375rem;
}

/* ---- Remember Me Checkbox ---- */

.remember-row {
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    background-color: #ffffff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

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

.checkbox-input:checked + .checkbox-custom::after {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(-45deg) translate(1px, -1px);
    display: block;
}

.checkbox-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ---- Submit Button ---- */

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
    letter-spacing: 0.1px;
}

.btn-login:hover {
    background-color: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-login-icon {
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

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

/* ---- Card Footer ---- */

.login-card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.register-prompt {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.register-link {
    font-weight: 600;
    color: var(--primary-color);
}

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

/* ---- Legal Text ---- */

.login-legal {
    margin-top: 1.5rem;
    font-size: 0.78rem;
    color: #aaaaaa;
    text-align: center;
}

.login-legal a {
    color: #aaaaaa;
    text-decoration: underline;
}

.login-legal a:hover {
    color: var(--text-secondary);
}

/* Keep the standalone authentication screens aligned with the product type scale. */
.login-title { font-size: clamp(1.75rem, 3vw, 2rem); }
.login-subtitle, .login-input, .btn-login { font-size: 1rem; }
.form-label { font-size: 1rem; line-height: 1.45; }
.forgot-link, .checkbox-text, .register-prompt { font-size: 0.9375rem; }
.field-error, .login-alert, .login-legal { font-size: 0.875rem; line-height: 1.5; }

/* ========================================
   RESPONSIVE
   ======================================== */

/* Tablet: hide left panel, center form */
@media (max-width: 960px) {
    .login-left {
        display: none;
    }

    .login-right {
        background-color: #ffffff;
        padding: 2rem 1.5rem;
    }

    .login-card {
        box-shadow: none;
        border: none;
        padding: 1.5rem 0;
    }

    /* Show brand at top of form on mobile */
    .login-right::before {
        content: '';
        display: block;
    }
}

/* Mobile: tighten spacing */
@media (max-width: 480px) {
    .login-right {
        padding: 1.5rem 1rem;
        justify-content: flex-start;
        padding-top: 3rem;
    }

    .login-card {
        max-width: 100%;
    }

    .login-title {
        font-size: 1.625rem;
    }


    .hero-headline {
        font-size: 1.75rem;
    }
}

/* Large screens: slightly wider left panel */
@media (min-width: 1280px) {
    .login-left {
        width: 520px;
        padding: 3.5rem;
    }

    .hero-headline {
        font-size: 2.5rem;
    }
}
