/* ============================================================
   Auth screens — deep emerald vault + rising light panel
   Distinct from the old boxed-field layout: circular crest ring,
   sliding tab pill, underline floating-label fields, trust strip.
   ============================================================ */

body.rx-auth-modern {
    margin: 0;
    min-height: 100dvh;
    font-family: 'Manrope', system-ui, sans-serif;
    background: #04240f;
    color: #0c2416;
    -webkit-tap-highlight-color: transparent;
}

.av-screen {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    max-width: 430px;
    margin: 0 auto;
    overflow: hidden;
    background:
        radial-gradient(78% 40% at 84% -6%, rgba(132, 204, 22, 0.5), transparent 62%),
        radial-gradient(64% 34% at 4% 12%, rgba(22, 163, 74, 0.55), transparent 66%),
        linear-gradient(176deg, #0d5028 0%, #073a1c 42%, #04240f 100%);
}

/* faint diagonal oil sheen — pure gradients, no paint-time blur */
.av-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
    mix-blend-mode: soft-light;
    background-image:
        repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 12px),
        repeating-linear-gradient(24deg, rgba(4, 36, 15, 0.2) 0 2px, transparent 2px 14px);
}

/* ── Brand block ── */
.av-brand {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: max(2.1rem, calc(env(safe-area-inset-top) + 1.1rem)) 1.5rem 1.5rem;
    text-align: center;
}

.av-ring {
    position: relative;
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(from 210deg, #bef264, #4ade80, #15803d, #bef264);
    box-shadow:
        0 0 0 1px rgba(190, 242, 100, 0.5),
        0 14px 34px rgba(4, 36, 15, 0.6);
}

.av-ring::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: linear-gradient(165deg, #0e5b2c, #04240f);
}

.av-ring img,
.av-ring__txt {
    position: relative;
    z-index: 1;
}

.av-ring img {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    object-fit: cover;
}

.av-ring__txt {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #d9f99d;
}

.av-brand__name {
    margin: 4px 0 0;
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: rgba(190, 242, 100, 0.9);
}

.av-brand__tag {
    margin: 0;
    max-width: 17rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.45;
    color: rgba(236, 252, 203, 0.72);
}

/* ── Light panel ── */
.av-panel {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    border-radius: 34px 34px 0 0;
    background: linear-gradient(180deg, #ffffff 0%, #f6fdee 100%);
    box-shadow: 0 -18px 44px rgba(4, 36, 15, 0.45);
}

.av-panel::before {
    content: '';
    position: absolute;
    top: 9px;
    left: 50%;
    width: 42px;
    height: 4px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: rgba(20, 83, 45, 0.16);
}

/* ── Sliding tab pill ── */
.av-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 8px;
    padding: 4px;
    border-radius: 999px;
    background: #e8f6d9;
    box-shadow: inset 0 2px 5px rgba(20, 83, 45, 0.14);
}

.av-tabs::before {
    content: '';
    position: absolute;
    z-index: 0;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    border-radius: 999px;
    background: linear-gradient(160deg, #22c55e, #15803d);
    box-shadow: 0 6px 14px rgba(21, 128, 61, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: transform 0.28s cubic-bezier(0.4, 1.3, 0.5, 1);
}

.av-tabs.is-right::before { transform: translateX(100%); }

.av-tabs a {
    position: relative;
    z-index: 1;
    padding: 9px 0;
    border-radius: 999px;
    text-align: center;
    text-decoration: none;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #4a6b52;
    transition: color 0.24s ease;
}

.av-tabs a.is-active { color: #ffffff; }

.av-heading {
    margin: 2px 0 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.28rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0c2416;
}

.av-heading + .av-subheading {
    margin: -10px 0 0;
    font-size: 0.76rem;
    font-weight: 600;
    color: #5d7f68;
}

/* ── Underline fields with floating caption ── */
.av-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.av-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0 8px;
    border-bottom: 2px solid rgba(20, 83, 45, 0.14);
    transition: border-color 0.2s ease;
}

.av-field:focus-within { border-bottom-color: #4ade80; }

.av-field__ico {
    flex: none;
    width: 20px;
    font-size: 0.86rem;
    text-align: center;
    color: #8aa892;
    transition: color 0.2s ease;
}

.av-field:focus-within .av-field__ico { color: #15803d; }

.av-field__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.av-field__cap {
    font-size: 0.56rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #7d9a86;
    transition: color 0.2s ease;
}

.av-field:focus-within .av-field__cap { color: #15803d; }

.av-field input {
    width: 100%;
    padding: 2px 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: 600 0.95rem/1.4 'Manrope', sans-serif;
    color: #0c2416;
}

.av-field input::placeholder {
    font-weight: 500;
    color: #a8bfae;
}

.av-field input[readonly] { color: #4a6b52; }

.av-eye {
    flex: none;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    background: #eaf7dc;
    color: #4a6b52;
    font-size: 0.82rem;
}

/* ── Row: remember / forgot ── */
.av-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #5d7f68;
}

.av-check,
.av-terms {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.av-terms {
    align-items: flex-start;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
    color: #5d7f68;
}

.av-check input,
.av-terms input {
    width: 17px;
    height: 17px;
    flex: none;
    accent-color: #16a34a;
}

.av-terms input { margin-top: 1px; }

.av-link,
.av-terms a {
    color: #15803d;
    font-weight: 800;
    text-decoration: none;
}

/* ── Submit ── */
.av-submit,
body .av-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-top: 2px;
    padding: 14px 14px 14px 20px;
    border: 0 !important;
    border-radius: 17px;
    cursor: pointer;
    overflow: hidden;
    font: inherit;
    color: #ffffff !important;
    background: linear-gradient(150deg, #4ade80 0%, #16a34a 44%, #14532d 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -3px 9px rgba(4, 36, 15, 0.4),
        0 14px 26px rgba(21, 128, 61, 0.36) !important;
    transition: transform 0.13s ease, filter 0.13s ease;
}

.av-submit::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 48%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent);
    pointer-events: none;
}

.av-submit:active { transform: translateY(2px); filter: brightness(1.06); }

.av-submit__txt {
    position: relative;
    font-size: 0.84rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(4, 36, 15, 0.4);
}

.av-submit__arrow {
    position: relative;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.78rem;
    color: #052e16;
    background: linear-gradient(160deg, #d9f99d, #a3e635);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ── Messages ── */
.av-msg {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.45;
}

.av-msg.is-error {
    color: #9f1239;
    background: #ffe4e6;
    border: 1px solid rgba(159, 18, 57, 0.18);
}

.av-msg.is-success {
    color: #14532d;
    background: #dcfce7;
    border: 1px solid rgba(20, 83, 45, 0.18);
}

.av-msg.hidden { display: none; }

/* ── Foot + trust strip ── */
.av-foot {
    margin: 2px 0 0;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #5d7f68;
}

.av-foot a {
    color: #15803d;
    font-weight: 800;
    text-decoration: none;
}

.av-trust {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 2px;
    padding-top: 13px;
    border-top: 1px dashed rgba(20, 83, 45, 0.16);
}

.av-trust span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.56rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b8a76;
}

.av-trust i {
    font-size: 0.9rem;
    color: #16a34a;
}

@media (max-height: 720px) {
    .av-ring { width: 64px; height: 64px; }
    .av-ring img { width: 50px; height: 50px; }
    .av-brand { padding-top: max(1.3rem, calc(env(safe-area-inset-top) + 0.7rem)); padding-bottom: 1.1rem; }
    .av-brand__tag { display: none; }
    .av-trust { display: none; }
}
