@import url('../cdn/fonts.googleapis.com/poppins-rubik.css');

* {
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

/* ---------- Background ---------- */
.bg-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    overflow-y: auto;
}

.bg-image::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('../../images/hospital.webp');
    background-size: cover;
    background-position: center;
    z-index: -2;
}

.bg-image::after {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(13, 32, 66, .78) 0%, rgba(17, 68, 122, .62) 100%);
    z-index: -1;
}

/* ---------- Card ---------- */
.login-wrap {
    width: 100%;
    max-width: 420px;
    display: flex;
    justify-content: center;
}

.login-card {
    position: relative;
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 24px;
    box-shadow: 0 30px 70px rgba(9, 22, 48, .45);
    padding: clamp(1.75rem, 4vw, 2.75rem);
    backdrop-filter: blur(6px);
    overflow: hidden;
    animation: cardIn .55s cubic-bezier(.2, .9, .3, 1.15);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(22px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

.brand {
    text-align: center;
}

.logo {
    max-width: 100%;
    height: 88px;
    margin-bottom: 18px;
}

.login-heading {
    font-weight: 600;
    font-size: 1.5rem;
    color: #14264a;
    margin: 0 0 .25rem;
    text-align: center;
}

.login-sub {
    color: #6b7a99;
    font-size: .95rem;
    margin-bottom: 1.4rem;
    text-align: center;
}

/* ---------- Steps (animated) ---------- */
.step {
    display: none;
}

.step-active {
    display: block;
    animation: stepIn .42s cubic-bezier(.2, .9, .3, 1.05);
}

@keyframes stepIn {
    from { opacity: 0; transform: translateX(26px); }
    to   { opacity: 1; transform: none; }
}

.step.step-back {
    animation: stepInBack .42s cubic-bezier(.2, .9, .3, 1.05);
}

@keyframes stepInBack {
    from { opacity: 0; transform: translateX(-26px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Inputs ---------- */
.form-floating > .form-control {
    border-radius: 14px;
    border: 1.5px solid #d9e0ec;
    padding-top: 1.55rem;
    padding-bottom: .5rem;
    height: 58px;
}

.form-floating > .form-control:focus {
    border-color: #2f6fed;
    box-shadow: 0 0 0 .18rem rgba(47, 111, 237, .18);
}

.form-floating > label {
    color: #8a97ad;
}

/* ---------- Buttons ---------- */
.btn-login {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: none;
    border-radius: 14px;
    padding: .85rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .02rem;
    color: #fff;
    background: linear-gradient(135deg, #2f6fed 0%, #1e4fc0 100%);
    box-shadow: 0 12px 24px rgba(30, 79, 192, .32);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(30, 79, 192, .42);
    color: #fff;
    filter: brightness(1.03);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    filter: grayscale(.2) brightness(.98);
    transform: none;
    cursor: not-allowed;
}

.btn-arrow {
    transition: transform .2s ease;
    font-size: 1.15rem;
}

.btn-login:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-reset {
    background: linear-gradient(135deg, #16a765 0%, #0f8a52 100%);
    box-shadow: 0 12px 24px rgba(15, 138, 82, .32);
}

/* ---------- Links ---------- */
.link-muted {
    color: #2f6fed;
    font-size: .9rem;
    cursor: pointer;
    text-decoration: none;
}

.link-muted:hover {
    text-decoration: underline;
}

.back-link {
    background: none;
    border: none;
    color: #6b7a99;
    font-size: .9rem;
    padding: 0;
    margin-bottom: .75rem;
    cursor: pointer;
    transition: color .15s ease;
}

.back-link:hover {
    color: #2f6fed;
}

.pw-match {
    min-height: 1.1rem;
    margin: 0 0 .6rem;
    font-size: .85rem;
    text-align: center;
    font-weight: 500;
    transition: color .15s ease;
}

.pw-match.is-ok {
    color: #16a765;
}

.pw-match.is-bad {
    color: #d13b3b;
}

.email-pill {
    display: inline-block;
    background: #eef3fc;
    color: #2f4d86;
    border-radius: 999px;
    padding: .28rem .8rem;
    font-size: .85rem;
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* ---------- Number-match 2FA ---------- */
.match-number-wrap {
    position: relative;
    width: 128px;
    height: 128px;
    margin: 1.4rem auto 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-number {
    position: relative;
    z-index: 2;
    width: 96px;
    height: 96px;
    border-radius: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #2f6fed 0%, #1e4fc0 100%);
    box-shadow: 0 14px 30px rgba(30, 79, 192, .4);
    animation: numberPop .5s cubic-bezier(.2, .9, .3, 1.4);
}

@keyframes numberPop {
    from { opacity: 0; transform: scale(.6); }
    to   { opacity: 1; transform: none; }
}

.pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 30px;
    border: 3px solid rgba(47, 111, 237, .45);
    animation: pulseRing 2s ease-out infinite;
}

.pulse-ring-2 {
    animation-delay: 1s;
}

@keyframes pulseRing {
    0%   { transform: scale(.75); opacity: .8; }
    100% { transform: scale(1.35); opacity: 0; }
}

.waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    color: #6b7a99;
    font-size: .92rem;
}

.waiting .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2f6fed;
    display: inline-block;
    animation: dotBounce 1.2s infinite ease-in-out;
}

.waiting .dot:nth-child(2) { animation-delay: .18s; }
.waiting .dot:nth-child(3) { animation-delay: .36s; }

.waiting-text {
    margin-left: .4rem;
}

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(.5); opacity: .4; }
    40%           { transform: scale(1);  opacity: 1; }
}

/* ---------- Legacy secure-IP modal ---------- */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    inset: 0;
    padding-top: 100px;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.45);
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 24px;
    border-radius: 18px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 24px 60px rgba(9, 22, 48, .4);
}

.close {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 480px) {
    .login-card { border-radius: 18px; }
    .logo { height: 72px; }
}
