﻿/* =========================================================
   LOGIN PAGE
   Colours follow the QMS logo: cyan, violet, green.
========================================================= */
:root {
    --auth-cyan: #2dd4f0;
    --auth-violet: #9b5de5;
    --auth-green: #34c77b;
    --auth-danger: #ef5a6f;
}

html, body {
    height: 100%;
}

.auth-shell {
    display: flex;
    min-height: 100vh;
    background: var(--phoenix-body-bg);
}

/* ---------------- BRAND PANEL ---------------- */
.auth-brand {
    position: relative;
    flex: 0 0 46%;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 3.5rem;
    overflow: hidden;
    color: #e8eefc;
    background: linear-gradient(150deg, #0b1630 0%, #111a3d 55%, #1d1647 100%);
}

    .auth-brand::before,
    .auth-brand::after {
        content: "";
        position: absolute;
        border-radius: 50%;
        filter: blur(70px);
        opacity: .35;
        animation: auth-drift 14s ease-in-out infinite alternate;
    }

    .auth-brand::before {
        width: 340px;
        height: 340px;
        top: -80px;
        right: -60px;
        background: var(--auth-cyan);
    }

    .auth-brand::after {
        width: 380px;
        height: 380px;
        bottom: -120px;
        left: -80px;
        background: var(--auth-violet);
        animation-delay: -6s;
    }

    .auth-brand > * {
        position: relative;
        z-index: 1;
    }

.auth-brand-logo {
    width: 96px;
    height: auto;
}

.auth-brand h1 {
    color: #fff;
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.auth-brand-lead {
    color: #aab6d3;
    font-size: 1rem;
    max-width: 26rem;
    margin-bottom: 2rem;
}

.auth-brand-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .auth-brand-list li {
        display: flex;
        align-items: center;
        gap: .75rem;
        padding: .45rem 0;
        font-size: .95rem;
    }

    .auth-brand-list i {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 2rem;
        height: 2rem;
        border-radius: .6rem;
        font-size: 1.05rem;
        color: var(--auth-cyan);
        background: rgba(45, 212, 240, .12);
    }

.auth-brand-foot {
    color: #7f8cab;
    font-size: .8rem;
}

/* ---------------- FORM PANEL ---------------- */
.auth-panel {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 25rem;
}

.auth-mobile-logo {
    display: block;
    width: 84px;
    height: auto;
    margin: 0 auto 1.5rem;
}

.auth-step {
    animation: auth-step-in .35s ease both;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: .35rem;
    color: var(--phoenix-emphasis-color);
}

.auth-sub {
    color: var(--phoenix-tertiary-color);
    margin-bottom: 1.75rem;
}

.auth-card .form-label {
    text-transform: none;
    font-size: .85rem;
    font-weight: 700;
    padding-left: 0;
    color: var(--phoenix-body-color);
}

.auth-card .form-control {
    min-height: 3rem;
}

.auth-card .form-icon {
    top: 50%;
    transform: translateY(-50%);
}

.auth-submit {
    min-height: 3rem;
    font-size: .95rem;
    font-weight: 700;
    border: 0;
    color: #fff;
    background: linear-gradient(95deg, #2f7df6, var(--auth-violet));
    transition: filter .2s ease, transform .2s ease;
}

    .auth-submit:hover:not(:disabled) {
        color: #fff;
        filter: brightness(1.1);
        transform: translateY(-1px);
    }

    .auth-submit:disabled {
        color: #fff;
        opacity: .65;
    }

.auth-alert {
    display: none;
    font-size: .875rem;
    padding: .7rem .9rem;
    border-radius: .5rem;
    margin-bottom: 1rem;
    color: var(--auth-danger);
    background: rgba(239, 90, 111, .12);
    border: 1px solid rgba(239, 90, 111, .35);
}

    .auth-alert.is-visible {
        display: block;
    }

    .auth-alert.is-info {
        color: #e0a100;
        background: rgba(224, 161, 0, .12);
        border-color: rgba(224, 161, 0, .35);
    }

/* ---------------- OTP ---------------- */
.otp-shield {
    position: relative;
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.9rem;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-cyan), var(--auth-violet));
}

    .otp-shield::before,
    .otp-shield::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 50%;
        border: 2px solid var(--auth-cyan);
        animation: otp-ripple 2.4s ease-out infinite;
    }

    .otp-shield::after {
        animation-delay: 1.2s;
    }

.otp-boxes {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin-bottom: 1rem;
}

.otp-box {
    flex: 1 1 0;
    min-width: 0;
    max-width: 3.25rem;
    height: 3.5rem;
    padding: 0;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    border-radius: .65rem;
    color: var(--phoenix-emphasis-color);
    background: var(--phoenix-body-bg);
    border: 1.5px solid var(--phoenix-border-color);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
    animation: otp-box-in .4s cubic-bezier(.2, .9, .3, 1.3) both;
}

    .otp-box:nth-child(2) { animation-delay: .05s; }
    .otp-box:nth-child(3) { animation-delay: .1s; }
    .otp-box:nth-child(4) { animation-delay: .15s; }
    .otp-box:nth-child(5) { animation-delay: .2s; }
    .otp-box:nth-child(6) { animation-delay: .25s; }

    .otp-box:focus {
        border-color: var(--auth-cyan);
        box-shadow: 0 0 0 3px rgba(45, 212, 240, .22);
    }

    .otp-box.is-filled {
        border-color: var(--auth-violet);
        animation: otp-pop .2s ease;
    }

.otp-boxes.is-error {
    animation: shake .4s ease;
}

    .otp-boxes.is-error .otp-box {
        border-color: var(--auth-danger);
    }

.otp-boxes.is-checking .otp-box {
    border-color: var(--auth-cyan);
    animation: otp-wave 1s ease-in-out infinite;
}

    .otp-boxes.is-checking .otp-box:nth-child(2) { animation-delay: .1s; }
    .otp-boxes.is-checking .otp-box:nth-child(3) { animation-delay: .2s; }
    .otp-boxes.is-checking .otp-box:nth-child(4) { animation-delay: .3s; }
    .otp-boxes.is-checking .otp-box:nth-child(5) { animation-delay: .4s; }
    .otp-boxes.is-checking .otp-box:nth-child(6) { animation-delay: .5s; }

.otp-boxes.is-done .otp-box {
    color: #fff;
    border-color: var(--auth-green);
    background: var(--auth-green);
}

.otp-expiry {
    height: 4px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: .4rem;
    background: var(--phoenix-border-color);
}

.otp-expiry-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--auth-cyan), var(--auth-violet));
    transition: width 1s linear;
}

.otp-expiry-text {
    font-size: .8rem;
    text-align: center;
    color: var(--phoenix-tertiary-color);
    margin-bottom: 1.25rem;
}

.otp-links {
    display: flex;
    justify-content: space-between;
    font-size: .875rem;
    margin-top: 1rem;
}

    .otp-links a.is-disabled {
        pointer-events: none;
        color: var(--phoenix-tertiary-color);
    }

/* ---------------- SUCCESS ---------------- */
.auth-success {
    text-align: center;
    padding: 2rem 0;
}

.auth-check {
    width: 5.5rem;
    height: 5.5rem;
    margin-bottom: 1.25rem;
}

    .auth-check circle {
        fill: none;
        stroke: var(--auth-green);
        stroke-width: 3;
        stroke-dasharray: 157;
        stroke-dashoffset: 157;
        animation: auth-draw .55s ease forwards;
    }

    .auth-check path {
        fill: none;
        stroke: var(--auth-green);
        stroke-width: 4;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-dasharray: 40;
        stroke-dashoffset: 40;
        animation: auth-draw .3s .45s ease forwards;
    }

.auth-progress {
    height: 3px;
    max-width: 10rem;
    margin: 1.25rem auto 0;
    border-radius: 3px;
    overflow: hidden;
    background: var(--phoenix-border-color);
}

    .auth-progress span {
        display: block;
        height: 100%;
        background: linear-gradient(90deg, var(--auth-cyan), var(--auth-green));
        animation: auth-fill 1.2s ease forwards;
    }

/* ---------------- ANIMATIONS ---------------- */
@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

@keyframes auth-step-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(40px, 30px) scale(1.15); }
}

@keyframes otp-ripple {
    from { transform: scale(1); opacity: .7; }
    to { transform: scale(1.7); opacity: 0; }
}

@keyframes otp-box-in {
    from { opacity: 0; transform: translateY(14px) scale(.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes otp-pop {
    50% { transform: scale(1.1); }
}

@keyframes otp-wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes auth-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes auth-fill {
    from { width: 0; }
    to { width: 100%; }
}

.input-error {
    animation: shake 0.35s ease;
    border-color: #dc3545 !important;
}

    .input-error:focus {
        box-shadow: 0 0 0 .15rem rgba(220,53,69,.25);
    }

@media (max-width: 380px) {
    .otp-boxes { gap: .35rem; }
    .otp-box { height: 3rem; font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell *, .auth-shell *::before, .auth-shell *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
