/* =========================
   AUTH SHEET — iOS-matching
   ========================= */

/* Root overlay */
#auth-sheet {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 500;
    align-items: flex-end;
    justify-content: center;
}
#auth-sheet.hidden {
    display: none;
}

/* Dim backdrop */
.auth-dim {
    position: absolute;
    inset: 0;
    background: rgba(30,10,20,.45);
    animation: authFade .25s ease both;
}
@keyframes authFade { from { opacity: 0; } to { opacity: 1; } }

/* Sheet panel */
.auth-panel {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: var(--lotti-sheet-bg, #FAF7FC);
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 40px rgba(97,56,81,.12);
    transform: translateY(100%);
    animation: authSlideUp .35s cubic-bezier(.34,1.2,.64,1) forwards;
    overflow: hidden;
}
@keyframes authSlideUp {
    to { transform: translateY(0); }
}

/* Handle */
.auth-handle {
    width: 36px; height: 4px;
    background: rgba(148,115,137,.25);
    border-radius: 2px;
    margin: 12px auto 4px;
}

/* Steps container */
.auth-steps-wrap {
    position: relative;
    overflow: hidden;
}

.auth-step {
    padding: 10px 24px 8px;
}
.auth-step.hidden {
    display: none;
}

/* Slide transitions */
.auth-step--slide-out-left {
    animation: authSlideLeft .28s ease forwards;
}
.auth-step--slide-in-right {
    animation: authSlideInRight .30s cubic-bezier(.34,1.0,.64,1) both;
}
.auth-step--slide-out-right {
    animation: authSlideOutRight .26s ease forwards;
}
.auth-step--slide-in-left {
    animation: authSlideInLeft .28s cubic-bezier(.34,1.0,.64,1) both;
}
@keyframes authSlideLeft {
    to { transform: translateX(-30px); opacity: 0; }
}
@keyframes authSlideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes authSlideOutRight {
    to { transform: translateX(30px); opacity: 0; }
}
@keyframes authSlideInLeft {
    from { transform: translateX(-30px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

/* Title */
.auth-h {
    font-size: 24px;
    font-weight: 700;
    color: var(--lotti-text-title, #613851);
    margin: 6px 0 6px;
    line-height: 1.2;
}
.auth-sub {
    font-size: 14px;
    color: var(--lotti-text-sub, #947389);
    margin: 0 0 20px;
    line-height: 1.45;
}

/* Back button */
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: #70ADF5;
    font-size: 15px;
    font-weight: 500;
    padding: 0;
    cursor: pointer;
    margin-bottom: 14px;
    -webkit-tap-highlight-color: transparent;
}
.auth-back-icon {
    width: 7px; height: 7px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* Input fields */
.auth-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(97,56,81,.06);
    margin-bottom: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
    cursor: text;
}
.auth-field.is-focused {
    border-color: rgba(255,181,200,.70);
    box-shadow: 0 2px 8px rgba(97,56,81,.06), 0 0 0 3px rgba(255,181,200,.18);
}
.auth-field-icon {
    font-size: 16px;
    flex-shrink: 0;
    opacity: .7;
    width: 20px;
    text-align: center;
}
.auth-field input {
    flex: 1;
    border: none;
    background: none;
    font-size: 16px;
    font-family: inherit;
    color: var(--lotti-text-title, #613851);
    outline: none;
    min-width: 0;
}
.auth-field input::placeholder {
    color: rgba(148,115,137,.55);
}

/* Error text */
.auth-field-error {
    font-size: 13px;
    color: #c0392b;
    min-height: 16px;
    margin: -4px 0 8px;
    padding: 0 2px;
}

/* OTP row */
.auth-otp-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px;
}
.auth-otp-box {
    width: 44px;
    height: 52px;
    background: #fff;
    border: 2px solid rgba(148,115,137,.18);
    border-radius: 14px;
    font-size: 22px;
    font-weight: 700;
    color: var(--lotti-text-title, #613851);
    text-align: center;
    outline: none;
    caret-color: transparent;
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}
.auth-otp-box::-webkit-inner-spin-button,
.auth-otp-box::-webkit-outer-spin-button { -webkit-appearance: none; }
.auth-otp-box.is-active {
    border-color: rgba(255,181,200,.80);
    box-shadow: 0 0 0 3px rgba(255,181,200,.20);
    caret-color: #FFB5C8;
}

/* Shake on OTP error */
@keyframes authShake {
    0%   { transform: translateX(0); }
    12%  { transform: translateX(-8px); }
    25%  { transform: translateX(7px); }
    37%  { transform: translateX(-6px); }
    50%  { transform: translateX(5px); }
    62%  { transform: translateX(-4px); }
    75%  { transform: translateX(3px); }
    87%  { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}
.auth-otp-row.is-shaking {
    animation: authShake .48s ease;
}

/* Button spacing */
.auth-cta {
    margin-top: 4px;
}

/* Disclaimer */
.auth-disclaimer {
    font-size: 11px;
    color: rgba(148,115,137,.65);
    text-align: center;
    margin: 12px 0 4px;
    line-height: 1.5;
}

/* Resend row */
.auth-resend {
    text-align: center;
    margin-top: 14px;
    font-size: 14px;
    color: var(--lotti-text-sub, #947389);
    min-height: 24px;
}
.auth-resend-btn {
    background: none;
    border: none;
    color: var(--lotti-btn-from, #FF99B8);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.auth-resend-btn:active { opacity: .7; }

/* reCAPTCHA slot */
#auth-recaptcha { margin: 4px 0; }

/* Spinner (reuse if needed) */
.auth-spinner {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}
.auth-spinner__ring {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 3px solid rgba(97,56,81,.12);
    border-top-color: var(--lotti-btn-from, #FF99B8);
    animation: authSpin .9s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }
