/* ============================================================
   A2Z Hisab - authentication pages (login / forgot / reset)
   Self-contained: does NOT depend on bootstrap or the old theme.
   Mobile-first. Change the --brand-* values below to re-colour
   the whole screen.
   ============================================================ */

:root {
    /* Brand ---------------------------------------------------- */
    --brand-900: #08203a;
    --brand-800: #0b3566;
    --brand-700: #0f4c94;
    --brand-600: #1462b8;
    --brand-500: #1d7ae0; /* primary accent */
    --brand-400: #3f95ef;
    --brand-300: #93c6f8;
    --brand-050: #eaf3fd;

    /* Neutrals ------------------------------------------------- */
    --ink: #101a24;
    --ink-2: #33414f;
    --muted: #5f6d7e;
    --line: #dde5ee;
    --field: #f7f9fc;
    --page: #eef3f9;
    --card: #ffffff;

    --danger: #c1362b;
    --danger-bg: #fdeceb;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(8, 32, 58, .05), 0 12px 32px -12px rgba(8, 32, 58, .18);

    --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
    height: 100%;
}

body.auth-body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

/* ============================================================
   Shell - stacked on phones, split screen on desktop
   ============================================================ */
.auth-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================
   Brand panel
   ============================================================ */
.auth-brand {
    position: relative;
    overflow: hidden;
    padding: 22px 20px 52px; /* extra bottom padding: the card overlaps it */
    color: #fff;
    background: linear-gradient(140deg, var(--brand-800) 0%, var(--brand-600) 55%, var(--brand-500) 100%);
}

    .auth-brand::after { /* soft glow */
        content: "";
        position: absolute;
        width: 420px;
        height: 420px;
        right: -160px;
        top: -200px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(147, 198, 248, .35) 0%, rgba(147, 198, 248, 0) 70%);
        pointer-events: none;
    }

.auth-brand__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}

/* Logo lockup ------------------------------------------------ */
.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: inherit;
}

.brand-mark {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: -ms-grid;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, .16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

    .brand-mark svg {
        width: 23px;
        height: 23px;
        display: block;
    }

.brand-name {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.brand-tag {
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .09em;
    text-transform: uppercase;
    opacity: .72;
    margin-top: 3px;
}

/* Copy ------------------------------------------------------- */
.auth-brand__title {
    margin: 18px 0 0;
    font-size: 19px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -.01em;
    color: rgba(255, 255, 255, .92);
}

.auth-brand__sub {
    margin: 10px 0 0;
    font-size: 15px;
    color: rgba(255, 255, 255, .82);
    max-width: 42ch;
}

.auth-points {
    list-style: none;
    margin: 22px 0 0;
    padding: 0;
}

    .auth-points li {
        display: flex;
        align-items: flex-start;
        gap: 11px;
        font-size: 14.5px;
        color: rgba(255, 255, 255, .9);
        margin-top: 12px;
    }

    .auth-points svg {
        flex: 0 0 auto;
        width: 19px;
        height: 19px;
        margin-top: 1px;
        color: var(--brand-300);
    }

/* Decorative chart ------------------------------------------- */
.auth-chart {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 130px;
    opacity: .5;
    pointer-events: none;
    z-index: 1;
}

/* On phones the brand panel is a compact banner: lockup + one line */
.auth-brand__sub,
.auth-points,
.auth-chart {
    display: none;
}

/* ============================================================
   Form side
   ============================================================ */
.auth-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    /* on phones the card sits just under the banner rather than floating
       in the middle of a tall empty column */
    justify-content: flex-start;
    align-items: center;
    padding: 0 16px 32px;
}

.auth-card {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 420px;
    margin-top: -32px; /* overlap the brand banner */
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 22px;
}

.auth-card__head {
    margin-bottom: 22px;
}

.auth-card__title {
    margin: 0;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--ink);
}

.auth-card__sub {
    margin: 6px 0 0;
    font-size: 14.5px;
    color: var(--muted);
}

/* ============================================================
   Fields
   ============================================================ */
.field {
    margin-bottom: 17px;
}

    .field > label,
    .field .control-label {
        display: block;
        margin-bottom: 7px;
        font-size: 13.5px;
        font-weight: 600;
        color: var(--ink-2);
    }

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

.field-icon {
    position: absolute;
    left: 13px;
    width: 19px;
    height: 19px;
    color: var(--muted);
    pointer-events: none;
    z-index: 2;
}

/* the input itself - also targets @Html.EditorFor output */
.auth-card .form-control,
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    font-family: inherit;
    font-size: 16px; /* 16px stops iOS zooming the page on focus */
    color: var(--ink);
    background: var(--field);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
    -webkit-appearance: none;
    appearance: none;
}

.auth-card .form-control::-webkit-input-placeholder {
    color: #97a3b3;
}

.auth-card .form-control::-moz-placeholder {
    color: #97a3b3;
}

.auth-card .form-control:-ms-input-placeholder {
    color: #97a3b3;
}

.auth-card .form-control::placeholder {
    color: #97a3b3;
}

.auth-card .form-control:hover {
    border-color: #c3d1e2;
}

.auth-card .form-control:focus {
    background: #fff;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px rgba(29, 122, 224, .16);
}

.auth-card .form-control.input-validation-error {
    border-color: var(--danger);
    background: var(--danger-bg);
}

    .auth-card .form-control.input-validation-error:focus {
        box-shadow: 0 0 0 4px rgba(193, 54, 43, .13);
    }

/* password reveal -------------------------------------------- */
.field-toggle {
    position: absolute;
    right: 6px;
    width: 38px;
    height: 38px;
    display: -ms-grid;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 8px;
    cursor: pointer;
    z-index: 2;
}

    .field-toggle:hover {
        color: var(--ink-2);
        background: #eef3f9;
    }

    .field-toggle svg {
        width: 19px;
        height: 19px;
        display: block;
    }

    .field-toggle .icon-hide {
        display: none;
    }

    .field-toggle.is-shown .icon-hide {
        display: block;
    }

    .field-toggle.is-shown .icon-show {
        display: none;
    }

.field-wrap.has-toggle .form-control {
    padding-right: 50px;
}

/* ============================================================
   Messages / validation
   ============================================================ */
.field .text-danger,
.field .field-validation-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--danger);
}

.auth-alert {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin-bottom: 18px;
    padding: 11px 13px;
    font-size: 13.5px;
    border-radius: var(--radius-sm);
}

    .auth-alert svg {
        flex: 0 0 auto;
        width: 18px;
        height: 18px;
        margin-top: 1px;
    }

.auth-alert--error {
    color: #8f2a21;
    background: var(--danger-bg);
    border: 1px solid #f4cbc7;
}

.auth-alert--ok {
    color: #0f4c94;
    background: var(--brand-050);
    border: 1px solid #bcd9f7;
}

/* validation summary rendered by Html.ValidationSummary */
.validation-summary-errors {
    margin-bottom: 18px;
    padding: 11px 13px;
    font-size: 13.5px;
    color: #8f2a21;
    background: var(--danger-bg);
    border: 1px solid #f4cbc7;
    border-radius: var(--radius-sm);
}

    .validation-summary-errors ul {
        margin: 0;
        padding-left: 18px;
    }

.validation-summary-valid {
    display: none;
}

/* ============================================================
   Buttons & links
   ============================================================ */
.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background: var(--brand-600);
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color .15s, transform .06s;
    box-shadow: 0 1px 2px rgba(8, 32, 58, .16);
    -webkit-appearance: none;
    appearance: none;
}

    .btn-auth:hover {
        background: var(--brand-700);
        color: #fff;
    }

    .btn-auth:active {
        transform: translateY(1px);
    }

.btn-auth--ghost {
    color: var(--brand-700);
    background: #fff;
    border: 1.5px solid var(--line);
    box-shadow: none;
}

    .btn-auth--ghost:hover {
        background: var(--brand-050);
        border-color: var(--brand-300);
        color: var(--brand-700);
    }

.auth-actions {
    margin-top: 4px;
}

    .auth-actions > * + * {
        margin-top: 10px;
    }

.auth-links {
    margin: 18px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}

    .auth-links a {
        color: var(--brand-700);
        font-weight: 600;
        text-decoration: none;
    }

        .auth-links a:hover {
            text-decoration: underline;
        }

.auth-foot {
    margin-top: 22px;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
}

/* ============================================================
   Responsive - small tablets and up
   ============================================================ */
@media (min-width: 600px) {
    .auth-brand {
        padding: 30px 32px 62px;
    }

    .auth-brand__sub {
        display: block;
    }

    .auth-brand__title {
        margin-top: 24px;
        font-size: 26px;
        font-weight: 700;
        letter-spacing: -.02em;
        color: #fff;
    }

    .auth-brand__inner {
        max-width: 560px;
    }

    .auth-main {
        padding: 0 32px 48px;
    }

    .auth-card {
        margin-top: -40px;
        padding: 32px 30px;
    }

    .auth-card__title {
        font-size: 26px;
    }
}

/* ============================================================
   Responsive - desktop split screen
   ============================================================ */
@media (min-width: 992px) {
    .auth-shell {
        flex-direction: row;
        height: 100vh;
        min-height: 640px;
    }

    .auth-brand {
        flex: 1 1 52%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 56px 6vw;
    }

    .auth-brand__inner {
        max-width: 480px;
        margin: 0;
    }

    .auth-brand__title {
        font-size: 34px;
        margin-top: 40px;
    }

    .auth-brand__sub {
        font-size: 16px;
        margin-top: 14px;
    }

    .auth-points {
        display: block;
        margin-top: 30px;
    }

    .auth-chart {
        display: block;
    }

    .auth-main {
        flex: 1 1 48%;
        justify-content: center;
        background: var(--card);
        padding: 40px 5vw;
        overflow-y: auto;
    }

    .auth-card {
        margin-top: 0;
        border: 0;
        box-shadow: none;
        padding: 0;
        max-width: 400px;
    }
}

@media (min-width: 1400px) {
    .auth-brand__title {
        font-size: 38px;
    }

    .auth-brand__inner {
        max-width: 540px;
    }
}

/* Landscape phones / short desktops - never trap the form */
@media (max-height: 680px) and (min-width: 992px) {
    .auth-shell {
        height: auto;
        min-height: 100vh;
    }

    .auth-brand {
        padding-top: 40px;
        padding-bottom: 40px;
    }
}

/* ============================================================
   Motion
   ============================================================ */
.fade-up {
    animation: authFadeUp .45s ease both;
}

@keyframes authFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fade-up {
        animation: none;
    }
}
