/* Phase 5 — auth usability + reset password */
.mata-auth-login-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-top: 15px;
}

.mata-auth-login-meta .mata-auth-remember {
    flex: 1 1 auto;
    margin-top: 0;
    cursor: default;
}

.mata-auth-forgot {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--mata-navy);
    font-size: .63rem;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mata-auth-forgot:hover,
.mata-auth-forgot:focus-visible {
    color: var(--mata-orange);
}

.mata-auth-reset-shell {
    width: min(920px, 100%);
}

.mata-auth-reset-art {
    min-height: 520px;
}

.mata-auth-reset-page .mata-auth-field input {
    font-size: .78rem;
}

@media (max-width: 991px) {
    .mata-auth-reset-art {
        min-height: 260px;
    }
}

@media (max-width: 640px) {
    .mata-auth-login-meta {
        flex-direction: column;
        gap: 10px;
    }

    .mata-auth-forgot {
        font-size: .72rem;
    }

    .mata-auth-reset-page .mata-auth-field input,
    .mata-auth-page .mata-auth-field input {
        font-size: 16px;
    }
}

/* Forgot/reset password boleh scroll; login biasa tetap satu layar. */
html.mata-auth-root.mata-auth-scrollable-root,
html.mata-auth-root.mata-auth-scrollable-root body.mata-auth.mata-auth-scrollable {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overscroll-behavior-y: auto;
}

html.mata-auth-root.mata-auth-scrollable-root body.mata-auth.mata-auth-scrollable {
    position: static;
    inset: auto;
    min-height: 100vh;
    min-height: 100dvh;
}

html.mata-auth-root.mata-auth-scrollable-root body.mata-auth.mata-auth-scrollable .mata-auth-page {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: 88px;
    padding-bottom: 36px;
    overflow: visible;
}

html.mata-auth-root.mata-auth-scrollable-root body.mata-auth.mata-auth-scrollable .mata-auth-shell {
    height: auto;
    min-height: 520px;
    max-height: none;
}

html.mata-auth-root.mata-auth-scrollable-root body.mata-auth.mata-auth-scrollable .mata-auth-art,
html.mata-auth-root.mata-auth-scrollable-root body.mata-auth.mata-auth-scrollable .mata-auth-form {
    height: auto;
}

@media (max-width: 991px) {
    html.mata-auth-root.mata-auth-scrollable-root body.mata-auth.mata-auth-scrollable .mata-auth-shell {
        grid-template-rows: auto auto;
    }
}

@media (max-width: 560px) {
    html.mata-auth-root.mata-auth-scrollable-root body.mata-auth.mata-auth-scrollable .mata-auth-page {
        padding: 70px 10px 22px;
    }

    html.mata-auth-root.mata-auth-scrollable-root body.mata-auth.mata-auth-scrollable .mata-auth-shell {
        min-height: 0;
    }
}

/* UI ringkas: hanya tampilkan informasi yang membantu tindakan. */
.mata-auth-login-meta.is-simple {
    justify-content: flex-end;
}

.mata-auth-form-heading h2 {
    margin-bottom: 22px;
}

.mata-auth-login-meta.is-simple .mata-auth-forgot {
    font-size: .72rem;
}

@media (max-width: 640px) {
    .mata-auth-login-meta.is-simple {
        flex-direction: row;
        justify-content: flex-end;
    }
}

/* =========================================================
   Login Mata V2 — standalone, clean, brand Mata, no nav/footer
   ========================================================= */
body.mata-auth.mata-auth-login-v2,
body.mata-auth.mata-auth-recovery-v2 {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 18%, rgba(83,223,202,.24), transparent 22%),
        radial-gradient(circle at 86% 82%, rgba(255,122,32,.20), transparent 24%),
        linear-gradient(145deg, #5e43e8 0%, #2f2aa6 40%, #17243c 100%);
}

body.mata-auth.mata-auth-login-v2::before,
body.mata-auth.mata-auth-recovery-v2::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .14;
    background-image: radial-gradient(rgba(255,255,255,.86) 1px, transparent 1px);
    background-size: 16px 16px;
}

.mata-login-v2-page,
.mata-recovery-v2-page {
    position: relative;
    z-index: 1;
    display: grid;
    width: 100%;
    min-height: 100dvh;
    place-items: center;
    padding: 78px 18px 30px;
}

.mata-login-v2-back {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    left: max(18px, env(safe-area-inset-left));
    z-index: 5;
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    padding: 0 15px;
    border: 2px solid rgba(23,36,60,.95);
    border-radius: 14px;
    color: var(--mata-navy);
    background: rgba(255,250,242,.96);
    box-shadow: 4px 4px 0 var(--mata-orange);
    font-size: .78rem;
    font-weight: 850;
    text-decoration: none;
    backdrop-filter: blur(10px);
}

.mata-login-v2-back:hover,
.mata-login-v2-back:focus-visible {
    color: var(--mata-navy);
    background: var(--mata-yellow);
    transform: translate(-1px,-1px);
}

.mata-login-v2-card,
.mata-recovery-v2-card {
    position: relative;
    width: min(100%, 500px);
    padding: clamp(24px, 4vw, 38px);
    border: 3px solid var(--mata-navy);
    border-radius: 28px;
    color: var(--mata-navy);
    background:
        radial-gradient(circle at 86% 13%, rgba(83,223,202,.18), transparent 18%),
        radial-gradient(circle at 11% 88%, rgba(243,232,59,.20), transparent 20%),
        #fffaf2;
    box-shadow: 12px 12px 0 var(--mata-orange);
    overflow: hidden;
}

.mata-login-v2-card::before,
.mata-recovery-v2-card::before {
    content: "M";
    position: absolute;
    right: -20px;
    bottom: -52px;
    color: rgba(23,36,60,.045);
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 12rem;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
}

.mata-login-v2-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 30px;
}

.mata-login-v2-logo {
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    padding: 8px;
    border: 2px solid var(--mata-navy);
    border-radius: 20px;
    background: #fff;
    box-shadow: 5px 5px 0 var(--mata-aqua);
    overflow: hidden;
}

.mata-login-v2-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mata-login-v2-brand strong,
.mata-login-v2-brand span {
    display: block;
}

.mata-login-v2-brand strong {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 1rem;
    font-weight: 900;
}

.mata-login-v2-brand span {
    margin-top: 2px;
    color: rgba(23,36,60,.58);
    font-size: .75rem;
    font-weight: 700;
}

.mata-login-v2-head,
.mata-recovery-v2-head {
    position: relative;
    z-index: 1;
}

.mata-login-v2-head h1,
.mata-recovery-v2-head h1 {
    margin: 0;
    color: var(--mata-navy);
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: clamp(2.15rem, 5vw, 3rem);
    font-weight: 900;
    line-height: .96;
    letter-spacing: -.05em;
}

.mata-recovery-v2-head p {
    margin: 10px 0 0;
    color: rgba(23,36,60,.65);
    font-size: .88rem;
    line-height: 1.6;
}

.mata-login-v2-form {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 17px;
    margin-top: 26px;
}

.mata-login-v2-field {
    margin: 0;
}

.mata-login-v2-field label,
.mata-login-v2-label-row label {
    margin: 0 0 8px;
    color: var(--mata-navy);
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: none;
}

.mata-login-v2-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.mata-login-v2-label-row label {
    margin: 0;
}

.mata-login-v2-label-row a {
    color: var(--mata-navy);
    font-size: .74rem;
    font-weight: 850;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mata-login-v2-label-row a:hover {
    color: var(--mata-orange);
}

.mata-login-v2-field input,
.mata-login-v2-password input {
    min-height: 56px;
    padding: 12px 15px;
    border: 2px solid rgba(23,36,60,.92);
    border-radius: 14px;
    color: var(--mata-navy);
    background: rgba(255,255,255,.92);
    font-size: .88rem;
    font-weight: 650;
}

.mata-login-v2-field input:focus,
.mata-login-v2-password input:focus {
    border-color: var(--mata-navy);
    outline: none;
    box-shadow: 0 0 0 4px rgba(83,223,202,.20);
}

.mata-login-v2-password input {
    padding-right: 78px;
}

.mata-login-v2-password button {
    right: 10px;
    min-height: 34px;
    padding: 0 10px;
    border: 1.5px solid var(--mata-navy);
    border-radius: 9px;
    color: var(--mata-navy);
    background: var(--mata-yellow);
    font-size: .68rem;
    font-weight: 900;
}

.mata-login-v2-submit {
    display: flex;
    width: 100%;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    padding: 0 17px;
    border: 2px solid var(--mata-navy);
    border-radius: 15px;
    color: var(--mata-navy);
    background: var(--mata-orange);
    box-shadow: 4px 4px 0 var(--mata-navy);
    font-size: .86rem;
    font-weight: 900;
    cursor: pointer;
}

.mata-login-v2-submit:hover,
.mata-login-v2-submit:focus-visible {
    background: var(--mata-yellow);
    transform: translate(-1px,-1px);
}

.mata-login-v2-submit i {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1.5px solid var(--mata-navy);
    border-radius: 50%;
    background: #fff;
    font-style: normal;
}

.mata-auth-login-v2 .alert,
.mata-auth-recovery-v2 .alert,
.mata-auth-login-v2 .mata-alert,
.mata-auth-recovery-v2 .mata-alert {
    position: relative;
    z-index: 2;
    margin: 18px 0 0;
    border-radius: 13px;
    font-size: .78rem;
}

/* Recovery */
body.mata-auth.mata-auth-recovery-v2 {
    position: static;
    min-height: 100dvh;
    height: auto;
    overflow-y: auto;
}

.mata-recovery-v2-page {
    min-height: 100dvh;
    padding-top: 88px;
    padding-bottom: 42px;
}

.mata-recovery-v2-card {
    width: min(100%, 590px);
}

.mata-recovery-v2-options {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 12px;
    margin-top: 24px;
}

.mata-recovery-v2-option {
    display: flex;
    min-height: 88px;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1.5px solid rgba(23,36,60,.16);
    border-radius: 16px;
    color: var(--mata-navy);
    background: rgba(255,255,255,.78);
    text-decoration: none;
}

.mata-recovery-v2-option.is-contact:hover,
.mata-recovery-v2-option.is-email.is-active {
    border-color: var(--mata-navy);
    color: var(--mata-navy);
    background: rgba(83,223,202,.12);
    box-shadow: 3px 3px 0 var(--mata-navy);
}

.mata-recovery-v2-option-icon {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1.5px solid var(--mata-navy);
    border-radius: 12px;
    background: var(--mata-yellow);
    font-size: 1rem;
    font-weight: 900;
}

.mata-recovery-v2-option strong,
.mata-recovery-v2-option small {
    display: block;
}

.mata-recovery-v2-option strong {
    font-size: .82rem;
    font-weight: 900;
}

.mata-recovery-v2-option small {
    margin-top: 3px;
    color: rgba(23,36,60,.58);
    font-size: .7rem;
    line-height: 1.4;
}

.mata-recovery-v2-form {
    padding-top: 22px;
    border-top: 1px dashed rgba(23,36,60,.15);
}

.mata-recovery-v2-email-status {
    padding: 11px 13px;
    border: 1.5px solid rgba(83,223,202,.35);
    border-radius: 12px;
    color: rgba(23,36,60,.72);
    background: rgba(83,223,202,.08);
    font-size: .76rem;
    line-height: 1.5;
    word-break: break-word;
}

.mata-recovery-v2-code {
    text-align: center;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 1.35rem !important;
    font-weight: 900 !important;
    letter-spacing: .32em;
    font-variant-numeric: tabular-nums;
}

.mata-recovery-v2-resend {
    position: relative;
    z-index: 1;
    margin-top: 15px;
    text-align: center;
}

.mata-recovery-v2-resend button {
    padding: 6px 8px;
    border: 0;
    color: var(--mata-navy);
    background: transparent;
    font-size: .73rem;
    font-weight: 850;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 640px) {
    .mata-login-v2-page,
    .mata-recovery-v2-page {
        align-items: center;
        padding: 74px 12px 20px;
    }

    .mata-login-v2-back {
        top: max(12px, env(safe-area-inset-top));
        left: max(12px, env(safe-area-inset-left));
        min-height: 40px;
        padding: 0 12px;
        border-radius: 12px;
        font-size: .72rem;
        box-shadow: 3px 3px 0 var(--mata-orange);
    }

    .mata-login-v2-card,
    .mata-recovery-v2-card {
        padding: 22px 18px;
        border-radius: 22px;
        box-shadow: 7px 7px 0 var(--mata-orange);
    }

    .mata-login-v2-brand {
        gap: 11px;
        margin-bottom: 24px;
    }

    .mata-login-v2-logo {
        width: 58px;
        height: 58px;
        border-radius: 17px;
        box-shadow: 4px 4px 0 var(--mata-aqua);
    }

    .mata-login-v2-head h1,
    .mata-recovery-v2-head h1 {
        font-size: 2rem;
    }

    .mata-login-v2-form {
        gap: 15px;
        margin-top: 22px;
    }

    .mata-login-v2-field input,
    .mata-login-v2-password input {
        min-height: 54px;
        font-size: 16px;
    }

    .mata-login-v2-submit {
        min-height: 56px;
    }

    .mata-recovery-v2-options {
        grid-template-columns: 1fr;
    }

    .mata-recovery-v2-option {
        min-height: 76px;
    }
}

@media (max-height: 650px) and (min-width: 641px) {
    .mata-login-v2-page {
        padding-top: 62px;
        padding-bottom: 18px;
    }

    .mata-login-v2-card {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .mata-login-v2-brand {
        margin-bottom: 20px;
    }

    .mata-login-v2-form {
        margin-top: 20px;
        gap: 13px;
    }

    .mata-login-v2-field input,
    .mata-login-v2-password input {
        min-height: 50px;
    }

    .mata-login-v2-submit {
        min-height: 52px;
    }
}

.mata-login-v2-back-form {
    position: static;
    margin: 0;
}

.mata-login-v2-back-form .mata-login-v2-back {
    cursor: pointer;
}

.mata-login-v2-otp-head p {
    margin: 10px 0 0;
    color: rgba(23,36,60,.65);
    font-size: .86rem;
    line-height: 1.55;
}

.mata-recovery-v2-email-status.is-error {
    position: relative;
    z-index: 2;
    margin-top: 18px;
    border-color: rgba(220,70,70,.28);
    color: #7d2b2b;
    background: rgba(255,225,225,.86);
}
