/* ── Phone OTP Login ────────────────────────────────────────────────────── */

:root {
    --potp-accent:   #5c3d3d;   /* deep mauve-brown to match site scheme   */
    --potp-accent-h: #472e2e;
    --potp-tab-act:  #7a5050;   /* slightly lighter for active tab          */
    --potp-bg:       #ffffff;
    --potp-surface:  #f8f4f4;   /* warm off-white                           */
    --potp-border:   #d9c8c8;   /* soft rose-grey border                    */
    --potp-text:     #2d1f1f;
    --potp-muted:    #7a6060;
    --potp-error-bg: #fef2f2;
    --potp-error-bd: #fecaca;
    --potp-error-tx: #b91c1c;
    --potp-success:  #16a34a;
    --potp-radius:   10px;
    --potp-shadow:   0 20px 50px rgba(80,40,40,.2);
}

/* ── Tab bar ────────────────────────────────────────────────────────────── */

.potp-tab-bar {
    display: flex;
    margin-bottom: 1.25rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid var(--potp-border);
}

.potp-tab {
    flex: 1;
    padding: .65rem 1rem;
    background: transparent;
    border: none;
    font-size: .9rem;
    font-weight: 500;
    color: var(--potp-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
    letter-spacing: .01em;
}

.potp-tab:not(:last-child) {
    border-right: 1.5px solid var(--potp-border);
}

.potp-tab--active {
    background: var(--potp-accent);
    color: #fff;
    font-weight: 600;
}

.potp-tab:not(.potp-tab--active):hover {
    background: rgba(92,61,61,.08);
    color: var(--potp-accent);
}

/* ── Inline phone panel ─────────────────────────────────────────────────── */

.potp-inline-panel {
    padding: .5rem 0 .75rem;
    animation: potp-fadein .2s ease;
}

.potp-inline-desc {
    font-size: .88rem;
    color: var(--potp-muted);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.potp-inline-field {
    margin-bottom: .9rem;
}

.potp-inline-field label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--potp-text);
    margin-bottom: .35rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Override WC theme aggressively so the input always shows */
.potp-inline-field input,
.potp-inline-field input[type="tel"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: .6rem .85rem !important;
    border: 1.5px solid var(--potp-border) !important;
    border-radius: 7px !important;
    background: #fff !important;
    font-size: .95rem !important;
    color: var(--potp-text) !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color .15s, box-shadow .15s !important;
    height: auto !important;
    max-width: 100% !important;
}

.potp-inline-field input:focus,
.potp-inline-field input[type="tel"]:focus {
    border-color: var(--potp-accent) !important;
    box-shadow: 0 0 0 3px rgba(92,61,61,.15) !important;
}

.potp-send-btn {
    display: inline-block;
    padding: .6rem 1.5rem;
    background: var(--potp-accent);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    letter-spacing: .02em;
}
.potp-send-btn:hover:not(:disabled) { background: var(--potp-accent-h); }
.potp-send-btn:active:not(:disabled){ transform: scale(.98); }
.potp-send-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    background: var(--potp-accent);
}

.potp-inline-error {
    color: var(--potp-error-tx);
    background: var(--potp-error-bg);
    border: 1px solid var(--potp-error-bd);
    border-radius: 6px;
    padding: .5rem .75rem;
    font-size: .85rem;
    margin-top: .65rem;
}

@keyframes potp-fadein {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0);   }
}

/* ── Modal overlay ──────────────────────────────────────────────────────── */

.potp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30,10,10,.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.potp-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

/* ── Modal card ─────────────────────────────────────────────────────────── */

.potp-modal {
    position: relative;
    background: var(--potp-bg);
    border-radius: var(--potp-radius);
    box-shadow: var(--potp-shadow);
    padding: 2.5rem 2.25rem 2rem;
    width: min(420px, calc(100vw - 2rem));
    transform: translateY(20px) scale(.97);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
    opacity: 0;
}
.potp-overlay.is-open .potp-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.potp-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--potp-muted);
    cursor: pointer;
    line-height: 1;
    padding: .25rem .4rem;
    border-radius: 6px;
    transition: background .15s;
}
.potp-close:hover { background: var(--potp-surface); }

/* ── Step content ───────────────────────────────────────────────────────── */

.potp-step { text-align: center; }

.potp-icon {
    font-size: 2.4rem;
    margin-bottom: .65rem;
    line-height: 1;
}

.potp-step h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--potp-text);
    margin: 0 0 .4rem;
}

.potp-subtitle {
    color: var(--potp-muted);
    font-size: .88rem;
    line-height: 1.55;
    margin: 0 0 1.5rem;
}

/* ── OTP digit inputs ───────────────────────────────────────────────────── */

.potp-otp-inputs {
    display: flex;
    gap: .5rem;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.potp-digit {
    width: 46px !important;
    height: 54px !important;
    text-align: center !important;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    border: 1.5px solid var(--potp-border) !important;
    border-radius: 9px !important;
    background: var(--potp-surface) !important;
    color: var(--potp-text) !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color .15s, box-shadow .15s;
    padding: 0 !important;
    max-width: 46px !important;
}
.potp-digit:focus {
    border-color: var(--potp-accent) !important;
    box-shadow: 0 0 0 3px rgba(92,61,61,.15) !important;
}
.potp-digit.is-filled {
    border-color: var(--potp-accent) !important;
    background: #f5eeee !important;
}

/* ── Primary button ─────────────────────────────────────────────────────── */

.potp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .75rem 1.25rem;
    background: var(--potp-accent);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    margin-bottom: .75rem;
}
.potp-btn:hover    { background: var(--potp-accent-h); }
.potp-btn:active   { transform: scale(.98); }
.potp-btn:disabled { opacity: .6; cursor: not-allowed; }

.potp-spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: potp-spin .7s linear infinite;
}
@keyframes potp-spin { to { transform: rotate(360deg); } }

/* ── Error ──────────────────────────────────────────────────────────────── */

.potp-error {
    color: var(--potp-error-tx);
    font-size: .85rem;
    padding: .5rem .75rem;
    background: var(--potp-error-bg);
    border-radius: 6px;
    border: 1px solid var(--potp-error-bd);
    margin: .25rem 0 .5rem;
}

/* ── Hints ──────────────────────────────────────────────────────────────── */

.potp-hint {
    font-size: .82rem;
    color: var(--potp-muted);
    margin: .4rem 0 0;
}
.potp-link-btn {
    color: var(--potp-accent);
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
}
.potp-link-btn:disabled { color: var(--potp-muted); cursor: default; text-decoration: none; }

/* ── Progress bar ───────────────────────────────────────────────────────── */

.potp-progress-bar {
    height: 4px;
    background: var(--potp-border);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 1.5rem;
}
.potp-progress-fill {
    height: 100%;
    width: 0;
    background: var(--potp-success);
    border-radius: 99px;
    transition: width 1.8s linear;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .potp-modal { padding: 2rem 1.25rem 1.5rem; }
    .potp-digit { width: 38px !important; height: 46px !important; font-size: 1.1rem !important; max-width: 38px !important; }
}
