@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Variables ── */
:root {
    --panel-bg:           rgba(9, 15, 28, 0.96);
    --panel-border:       rgba(9, 133, 124, 0.25);
    --teal:               #09857C;
    --teal-mid:           #0D938F;
    --teal-bright:        #0fb8ac;
    --text-primary:       #ffffff;
    --text-secondary:     rgba(255, 255, 255, 0.58);
    --text-muted:         rgba(255, 255, 255, 0.28);
    --input-bg:           rgba(255, 255, 255, 0.07);
    --input-border:       rgba(255, 255, 255, 0.13);
    --input-focus-glow:   rgba(9, 133, 124, 0.22);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

/* ── Page wrapper ── */
.login-page {
    position: relative;
    min-height: 100vh;
}

/* ── Full-bleed carousel background ── */
.login-carousel-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.login-carousel-bg .carousel,
.login-carousel-bg .carousel-inner,
.login-carousel-bg .carousel-item {
    height: 100vh;
}

.login-carousel-bg .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: kenBurns 20s ease-in-out infinite alternate;
}

/* General dark overlay over all images */
.carousel-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

/* Gradient blend: dark on panel side, fades right */
.carousel-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(9, 15, 28, 0.65) 0%, rgba(9, 15, 28, 0.25) 48%, transparent 70%);
}

/* Carousel captions — right half only */
.carousel-caption {
    z-index: 3;
    left: 50%;
    right: 4%;
    text-align: left;
}

/* Carousel indicators — right half */
.carousel-indicators {
    z-index: 10;
    left: 50%;
    right: 4%;
    justify-content: flex-start;
    margin-bottom: 2.5rem;
}

.carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.5);
    margin: 0 4px;
    transition: all 0.3s;
    opacity: 1;
}

.carousel-indicators .active {
    width: 24px;
    border-radius: 8px;
    background-color: #ffffff;
}

/* ── Login panel ── */
.login-panel {
    position: relative;
    z-index: 10;
    width: 45%;
    min-height: 100vh;
    background: var(--panel-bg);
    border-right: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    overflow-y: auto;
}

/* Form inner container */
.login-inner {
    width: 100%;
    max-width: 380px;
    animation: fadeInUp 0.7s ease-out both;
}

/* ── Logo ── */
.login-logo {
    display: block;
    margin: 0 auto 2.5rem;
    height: 52px;
}

/* ── Typography ── */
.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 0.4rem;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 400;
}

/* ── Form inputs (dark glass) ── */
.form-floating > .form-control {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-primary);
    height: calc(3.5rem + 2px);
    line-height: 1.25;
}

.form-floating > .form-control::placeholder {
    color: transparent;
}

.form-floating > .form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--teal);
    box-shadow: 0 0 0 4px var(--input-focus-glow);
    color: var(--text-primary);
    outline: none;
}

.form-floating > label {
    color: var(--text-secondary);
    padding: 1rem 0.75rem;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--teal-bright);
    opacity: 1;
}

/* Browser autofill — prevent yellow/blue override */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #0b1422 inset;
    -webkit-text-fill-color: #ffffff;
    transition: background-color 5000s ease-in-out 0s;
}

/* ── Password toggle ── */
.password-wrapper {
    position: relative;
}

.toggle-password-btn {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 10;
    padding: 0;
    transition: color 0.2s;
}

.toggle-password-btn:hover {
    color: var(--teal-bright);
}

/* ── Links ── */
.forgot-link {
    color: var(--teal-bright);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #ffffff;
}

#btnBackToLogin {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s;
}

#btnBackToLogin:hover {
    color: var(--text-primary);
}

/* ── Primary button ── */
.btn-login {
    display: block;
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--teal), var(--teal-mid));
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(9, 133, 124, 0.35);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(9, 133, 124, 0.52);
    background: linear-gradient(135deg, var(--teal-mid), var(--teal-bright));
    color: #ffffff;
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(9, 133, 124, 0.3);
}

/* ── Error messages ── */
#txtError,
#txtErrorMfa {
    font-size: 0.875rem;
    color: #fc8181;
    min-height: 20px;
    margin: 0;
}

/* ── MFA code input ── */
#mfaCode {
    text-align: center;
    font-size: 1.8rem;
    letter-spacing: 0.4em;
    font-weight: 600;
}

/* ── Copyright ── */
.login-copyright {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
}

/* ── Carousel captions text shadow ── */
.text-shadow {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

/* ── Animations ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes kenBurns {
    0%   { transform: scale(1); }
    100% { transform: scale(1.12); }
}

/* ── Responsive — mobile/tablet ── */
@media (max-width: 991.98px) {
    .login-panel {
        width: 100%;
        border-right: none;
        background: rgba(9, 15, 28, 0.94);
        padding: 2.5rem 1.5rem;
    }

    .login-carousel-bg .carousel-item img {
        filter: brightness(0.45);
    }

    .carousel-indicators,
    .carousel-caption {
        display: none !important;
    }
}
