/* ABHARSH Healthcare - shared two-column authentication shell.
   Used by the patient login, signup and receipt lookup pages, and by the
   hospital staff login. Requires abharsh-brand.css.

   Form controls are styled through Bootstrap's `.form-control` class because
   the Django form widgets emit it; this keeps forms.py untouched. */

.ab-auth {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 69px);
    padding: 48px 24px 64px;
    background: linear-gradient(180deg, #F7FBFD 0%, var(--ab-pale) 100%);
}

/* Background pattern ---------------------------------------------------- */

.ab-auth__decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    color: rgba(7, 59, 122, .07);
}

.ab-decor {
    position: absolute;
    color: inherit;
}

.ab-decor--plus-a {
    left: 3.5%;
    top: 46%;
    width: 44px;
}

.ab-decor--plus-b {
    left: 7%;
    top: 58%;
    width: 30px;
}

.ab-decor--plus-c {
    right: 9%;
    top: 14%;
    width: 40px;
}

.ab-decor--plus-d {
    right: 4%;
    bottom: 18%;
    width: 26px;
}

.ab-decor--dots-a {
    left: 2%;
    bottom: 12%;
    width: 92px;
}

.ab-decor--dots-b {
    right: 5%;
    top: 30%;
    width: 78px;
}

.ab-decor--lines-left {
    left: -60px;
    top: 4%;
    width: 320px;
}

.ab-decor--lines-right {
    right: -70px;
    bottom: 0;
    width: 380px;
}

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

.ab-auth__card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    width: 100%;
    max-width: 940px;
    overflow: hidden;
    border-radius: var(--ab-radius-card);
    background: var(--ab-white);
    box-shadow: var(--ab-shadow-lg);
}

.ab-auth__card--wide {
    max-width: 1040px;
}

.ab-auth__card--even {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Gradient trust panel -------------------------------------------------- */

.ab-auth__aside {
    /* Sits in the left column on desktop while staying second in the DOM, so
       the form leads both the mobile layout and the tab order. */
    order: -1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 52px 40px;
    background: linear-gradient(160deg, var(--ab-navy-deep) 0%, var(--ab-navy) 42%, var(--ab-teal) 100%);
    color: var(--ab-white);
}

.ab-auth__aside-icon {
    width: 108px;
    height: 108px;
    margin: 0 auto 34px;
    color: rgba(255, 255, 255, .85);
}

.ab-auth__aside-title {
    margin: 0 0 12px;
    font-size: clamp(1.5rem, 2.6vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.22;
}

.ab-auth__aside-text {
    margin: 0;
    font-size: .97rem;
    color: rgba(255, 255, 255, .88);
}

.ab-auth__divider {
    width: 100%;
    height: 1px;
    margin: 28px 0;
    border: 0;
    background: rgba(255, 255, 255, .26);
}

.ab-trust {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ab-trust__item {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: .95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .94);
}

.ab-trust__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .45);
    background: rgba(255, 255, 255, .12);
}

.ab-trust__icon svg {
    width: 21px;
    height: 21px;
}

/* Row variant used where the panel is short and wide. */
.ab-trust--row {
    flex-direction: row;
    justify-content: center;
    gap: 18px;
    text-align: center;
}

.ab-trust--row .ab-trust__item {
    flex: 1 1 0;
    flex-direction: column;
    gap: 10px;
    font-size: .8rem;
    line-height: 1.35;
}

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

.ab-auth__panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 52px 48px;
}

.ab-auth__panel-inner {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.ab-auth__heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 26px;
}

.ab-auth__heading-icon {
    flex: none;
    width: 42px;
    height: 42px;
    margin-top: 2px;
    color: var(--ab-teal-dark);
}

.ab-auth__title {
    margin: 0 0 4px;
    font-size: clamp(1.45rem, 3vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    color: var(--ab-navy);
}

.ab-auth__subtitle {
    margin: 0;
    font-size: .95rem;
    color: var(--ab-muted);
}

/* Progress steps -------------------------------------------------------- */

.ab-steps {
    display: flex;
    gap: 8px;
    margin: 0 0 30px;
    padding: 0;
    list-style: none;
}

.ab-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1 1 0;
    padding-bottom: 14px;
    border-bottom: 3px solid var(--ab-border);
    font-size: .93rem;
    font-weight: 600;
    color: var(--ab-muted);
}

.ab-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--ab-border);
    color: #4A5872;
    font-size: .82rem;
}

.ab-step--active {
    border-bottom-color: var(--ab-teal);
    color: var(--ab-navy);
}

.ab-step--active .ab-step__num {
    background: var(--ab-teal-dark);
    color: var(--ab-white);
}

/* Field groups ---------------------------------------------------------- */

.ab-form-section {
    margin: 0 0 20px;
    padding: 0;
    border: 0;
}

.ab-form-section + .ab-form-section {
    margin-top: 28px;
}

.ab-form-section__legend {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 16px;
    padding: 0;
    font-size: .9rem;
    font-weight: 700;
    color: var(--ab-teal-dark);
}

.ab-form-section__legend::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--ab-border);
}

.ab-field {
    margin-bottom: 18px;
}

.ab-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.ab-label {
    display: block;
    margin-bottom: 7px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--ab-text);
}

.ab-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ab-input-icon {
    position: absolute;
    left: 15px;
    width: 19px;
    height: 19px;
    color: var(--ab-muted);
    pointer-events: none;
}

/* Django widgets render with `.form-control`; scope the restyle to this shell. */
.ab-auth .form-control {
    width: 100%;
    min-height: var(--ab-control-h);
    padding: 12px 16px;
    border: 1px solid var(--ab-border);
    border-radius: var(--ab-radius-field);
    background: var(--ab-white);
    color: var(--ab-text);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.ab-auth .form-control::placeholder {
    color: #78889C;
}

.ab-auth .form-control:hover {
    border-color: #BCCBDC;
}

.ab-auth .form-control:focus {
    outline: none;
    border-color: var(--ab-teal-dark);
    box-shadow: 0 0 0 3px rgba(24, 166, 166, .22);
}

.ab-input-wrap--icon .form-control {
    padding-left: 46px;
}

.ab-input-wrap--toggle .form-control {
    padding-right: 50px;
}

.ab-auth select.form-control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23647084' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px 18px;
    cursor: pointer;
}

.ab-toggle {
    position: absolute;
    right: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ab-muted);
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease;
}

.ab-toggle:hover {
    background: var(--ab-pale);
    color: var(--ab-navy);
}

.ab-toggle svg {
    width: 20px;
    height: 20px;
}

/* The UA `[hidden]` rule does not reach inline SVG, so hide these explicitly. */
.ab-toggle[hidden],
.ab-toggle svg[hidden] {
    display: none;
}

.ab-help {
    display: block;
    margin-top: 7px;
    font-size: .85rem;
    color: var(--ab-muted);
}

/* Django renders field errors as <ul class="errorlist">. */
.ab-auth .errorlist {
    margin: 7px 0 0;
    padding: 0;
    list-style: none;
    color: var(--ab-danger);
    font-size: .85rem;
}

/* Options row ----------------------------------------------------------- */

.ab-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 4px 0 22px;
}

.ab-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: .93rem;
    color: var(--ab-text);
    cursor: pointer;
}

.ab-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ab-navy);
    cursor: pointer;
}

.ab-privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 4px 0 22px;
    font-size: .85rem;
    color: var(--ab-muted);
}

.ab-privacy-note svg {
    flex: none;
    width: 17px;
    height: 17px;
    margin-top: 3px;
    color: var(--ab-teal-dark);
}

/* Secondary links ------------------------------------------------------- */

.ab-auth__footer {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--ab-border);
    text-align: center;
}

.ab-auth__footer p {
    margin: 0 0 8px;
    font-size: .93rem;
    color: var(--ab-muted);
}

.ab-alt-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: .93rem;
    color: var(--ab-muted);
}

.ab-alt-link svg {
    flex: none;
    width: 18px;
    height: 18px;
    color: var(--ab-teal-dark);
}

.ab-alt-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin: 0 0 4px;
}

.ab-or {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0 18px;
    font-size: .85rem;
    color: var(--ab-muted);
}

.ab-or::before,
.ab-or::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--ab-border);
}

.ab-auth__back {
    margin-top: 14px;
    text-align: center;
}

/* Responsive ------------------------------------------------------------ */

@media (max-width: 767.98px) {
    .ab-auth {
        min-height: 0;
        padding: 24px 16px 44px;
    }

    .ab-auth__card,
    .ab-auth__card--wide,
    .ab-auth__card--even {
        grid-template-columns: minmax(0, 1fr);
        max-width: 460px;
    }

    .ab-auth__aside {
        /* Stacks below the form on small screens. */
        order: 0;
        padding: 34px 26px;
        text-align: center;
    }

    .ab-auth__aside-icon {
        width: 74px;
        height: 74px;
        margin-bottom: 20px;
    }

    .ab-trust {
        gap: 16px;
    }

    .ab-trust__item {
        justify-content: flex-start;
        text-align: left;
        max-width: 260px;
        margin: 0 auto;
    }

    .ab-auth__panel {
        padding: 34px 24px 30px;
    }

    .ab-field-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ab-decor--lines-left,
    .ab-decor--lines-right,
    .ab-decor--dots-a,
    .ab-decor--dots-b,
    .ab-decor--plus-a,
    .ab-decor--plus-b {
        display: none;
    }
}

@media (max-width: 420px) {
    .ab-trust--row {
        flex-direction: column;
    }

    .ab-trust--row .ab-trust__item {
        flex-direction: row;
        text-align: left;
        font-size: .95rem;
    }

    .ab-step {
        font-size: .85rem;
        gap: 7px;
    }
}
