/* ============================================
   Payonclick India — API partner sign-up (signup.css)

   The page wears payonclick.in/register's look: auth.css and theme-tokens.css
   are loaded straight from payonclick.in (see signup.html), so the shared
   parts can never drift. What lives HERE is what those pages keep in their
   own <style> blocks, copied as-is:
     1. templates/register.html      -> .reg-form-section (form column + short-screen tiers)
     2. templates/verify_otp.html    -> OTP boxes, timer, alert box, resend
     3. templates/registration_success.html -> the "account created" card
   plus the few pieces only this page has (business type preview, hint, back link).
   ============================================ */

/* ---- Page frame: auth.css centres one card in a row-flex body; this page also
        carries a back link under the card, so the body stacks vertically. ---- */
body.psu-page { flex-direction: column; padding: 0; }
.psu-page .auth-container { min-height: 0; padding-top: 28px; padding-bottom: 8px; }
.psu-back { position: relative; z-index: 1; margin: 6px 0 26px; text-align: center; font-size: 13px; }
.psu-back a { color: rgba(255,255,255,0.92); text-decoration: none; font-weight: 500; }
.psu-back a:hover { color: #fff; text-decoration: underline; }
.psu-back i { font-size: 11px; margin-right: 6px; }
[hidden] { display: none !important; }

/* ── 1. register.html — right panel holds the long form ── */
.reg-form-section {
    padding: clamp(20px, 3vw, 40px) clamp(20px, 2.5vw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(102,126,234,0.25) transparent;
}
.reg-form-section::-webkit-scrollbar { width: 4px; }
.reg-form-section::-webkit-scrollbar-track { background: transparent; }
.reg-form-section::-webkit-scrollbar-thumb { background: rgba(102,126,234,0.25); border-radius: 4px; }
.reg-form-section .form-header-logo img { display: block; height: 45px; width: auto; }

.reg-form-section .form-row { margin-bottom: 16px; }
.reg-form-section .form-header { margin-bottom: 24px; }
.reg-form-section .form-options { margin-bottom: 20px; }
.reg-form-section .btn-auth { margin-bottom: 16px; }
.reg-form-section .divider { margin-bottom: 16px; }

.reg-form-section .password-wrapper + label { max-width: calc(100% - 52px); }
.reg-form-section .password-wrapper:focus-within + label,
.reg-form-section .form-group:has(.password-wrapper input:not(:placeholder-shown)) .password-wrapper + label { max-width: calc(100% - 24px); }
@media (min-width: 769px) and (max-width: 1300px) {
    .reg-form-section .form-group > label { font-size: 13px; }
}
@media (min-width: 769px) and (max-width: 960px) {
    .reg-form-section .form-group > label { font-size: 12px; }
}

@media (min-width: 769px) and (max-height: 900px) {
    .reg-form-section { padding-top: clamp(16px, calc(8vh - 32px), 40px); padding-bottom: clamp(16px, calc(8vh - 32px), 40px); }
    .reg-form-section .form-header { margin-bottom: clamp(12px, calc(4vh - 12px), 24px); }
    .reg-form-section .form-header-logo { margin-bottom: clamp(8px, calc(5.667vh - 26px), 25px); }
    .reg-form-section .form-header-logo img { height: clamp(32px, calc(4.333vh + 6px), 45px); }
    .reg-form-section .form-header h1 {
        font-size: min(clamp(19px, 2.2vw, 28px), clamp(21px, calc(2.333vh + 7px), 28px));
        margin-bottom: clamp(2px, calc(2vh - 10px), 8px);
    }
    .reg-form-section .form-row { margin-bottom: clamp(10px, calc(2vh - 2px), 16px); }
    .reg-form-section .form-group input,
    .reg-form-section .form-group select,
    .reg-form-section .country-code,
    .reg-form-section .btn-auth { padding-top: clamp(10px, calc(1.333vh + 2px), 14px); padding-bottom: clamp(10px, calc(1.333vh + 2px), 14px); }
    .reg-form-section .form-group > label { top: calc(clamp(10px, calc(1.333vh + 2px), 14px) + 2px); }
    .reg-form-section .form-options { margin-bottom: clamp(12px, calc(2.667vh - 4px), 20px); }
    .reg-form-section .btn-auth { margin-bottom: clamp(10px, calc(2vh - 2px), 16px); }
    .reg-form-section .divider { margin-bottom: clamp(8px, calc(2.667vh - 8px), 16px); }
}
@media (min-width: 769px) and (max-height: 600px) {
    .reg-form-section .form-header p { display: none; }
    .reg-form-section .form-header h1 { margin-bottom: 0; }
    .reg-form-section .divider { display: none; }
}
@media (max-width: 768px) {
    .reg-form-section { padding: 30px 25px; overflow-y: visible; }
}
@media (max-width: 480px) {
    .reg-form-section { padding: 22px 18px; }
}

/* ── Only on this page ── */
.form-header-logo a { display: inline-block; }

/* A select floats its label the way auth.css floats an input's (.has-value). */
.reg-form-section .form-group select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    cursor: pointer;
    color: var(--text-primary, #1e293b);
    background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%);
    background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}
[data-theme="dark"] .reg-form-section .form-group select {
    background-image: linear-gradient(45deg, transparent 50%, #8d8d8d 50%), linear-gradient(135deg, #8d8d8d 50%, transparent 50%);
    background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}
/* Floated label for the select. auth.css floats it with `.form-group.has-value > label`
   (0,2,1), but the short-screen tier above re-sets `top` at the same specificity and
   wins by coming later, so the label sat on the chosen text. One class more wins back. */
.reg-form-section .form-group.has-value > label,
.reg-form-section .form-group:has(select:focus) > label {
    top: -10px;
    left: 12px;
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
}
.form-group select.invalid { border-color: #dc2626 !important; }
.form-group select.valid { border-color: #16a34a !important; }

.field-hint {
    font-size: 11.5px;
    color: var(--text-muted, #64748b);
    margin-top: 6px;
    line-height: 1.5;
}

.kyc-preview {
    margin-top: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    background: var(--brand-bg, #ede9fe);
    border: 1px dashed rgba(102,126,234,0.45);
    font-size: 12px;
    color: var(--text-secondary, #475569);
    line-height: 1.6;
}
.kyc-preview strong { color: var(--text-primary, #1e293b); font-weight: 600; }
.kyc-preview ul { margin: 4px 0 0 18px; padding: 0; }

.form-options label a { color: var(--brand-text, #667eea); font-weight: 600; text-decoration: none; }
.form-options label a:hover { text-decoration: underline; }
.terms-msg { margin: -12px 0 14px; }

.psu-sub-footer { margin-top: 8px; font-size: 12.5px; }

.psu-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.psu-noscript { margin-top: 16px; font-size: 13px; color: var(--danger-text, #dc2626); }

/* ── 2. verify_otp.html ── */
.mobile-display {
    background: linear-gradient(135deg, var(--bg-subtle) 0%, var(--bg-muted) 100%);
    padding: 12px 18px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    animation: fadeInUp 0.8s ease-out 0.25s both;
}
.mobile-display i { color: var(--brand-text); margin-right: 8px; }

.timer-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 18px 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 25px;
    color: white;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}
.timer-text { font-size: 12px; opacity: 0.9; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 1px; }
.timer-countdown { font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: 2px; }
.timer-countdown.expired { color: var(--warning-text); }

.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    animation: fadeInUp 0.8s ease-out 0.35s both;
}
.otp-input {
    width: clamp(42px, 5vw, 50px);
    height: clamp(48px, 5.5vw, 58px);
    text-align: center;
    font-size: clamp(18px, 2.2vw, 24px);
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    background: var(--bg-subtle);
    color: var(--text-primary);
}
.otp-input:focus {
    border-color: var(--border-color);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(102,126,234,0.15);
    outline: none;
}
.otp-input.filled { border-color: var(--border-color); background: var(--info-bg); }
.otp-input.valid { border-color: var(--border-color); background: rgba(16,185,129,0.05); }
.otp-input.error { border-color: var(--border-color); background: rgba(239,68,68,0.05); animation: shake 0.4s ease; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.alert-box {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
}
.alert-box.show { display: flex; }
.alert-box.error {
    background: linear-gradient(135deg, rgba(239,68,68,0.1), rgba(220,38,38,0.1));
    color: var(--danger-text);
    border: 1px solid rgba(220,38,38,0.2);
}
.alert-box.success {
    background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(22,163,74,0.1));
    color: var(--success-text);
    border: 1px solid rgba(22,163,74,0.2);
}
.alert-box i { font-size: 16px; }
.alert-close-btn { margin-left: auto; background: none; border: none; font-size: 16px; cursor: pointer; opacity: 0.7; color: inherit; }
#alertMessage, .flash-toast-msg { white-space: pre-line; }

.resend-section {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    margin-bottom: 18px;
    animation: fadeInUp 0.8s ease-out 0.45s both;
}
.resend-text { font-size: 13px; color: var(--text-primary); margin-bottom: 12px; }
.btn-resend {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--brand-text);
    padding: 10px 25px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}
.btn-resend:hover:not(:disabled) { background: var(--sld-brand); color: white; }
.btn-resend:disabled { border-color: var(--border-color); color: var(--text-muted); cursor: not-allowed; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--brand-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}
.back-link i { font-size: 12px; }

@media (max-width: 480px) {
    .otp-inputs { gap: 8px; }
    .otp-input { width: 42px; height: 48px; font-size: 18px; border-radius: 10px; }
    .timer-countdown { font-size: 26px; }
}

/* ── 3. registration_success.html — the account-created card, sized to FIT ──
   Colours, the tick, the User ID box and the buttons are registration_success.html's.
   The layout is this page's own, because the partner card carries more (business
   facts, KYC documents) and must still fit ANY screen without the page scrolling:
     * the card is at most one screen tall (100dvh minus a margin);
     * header and footer (the actions) never scroll away;
     * the body sits between them in two columns on wide screens, one on narrow
       ones, and scrolls inside the card only when the screen is too short;
     * every size steps down with the screen HEIGHT (clamp + vh), as
       register.html's short-screen tiers do. */
body.psu-is-done .psu-back { display: none; }

.psu-done-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 2.5vh, 28px) clamp(8px, 2vw, 24px);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
}
.done-card {
    width: 100%;
    max-width: 1040px;
    max-height: calc(100vh - 2 * clamp(8px, 2.5vh, 28px));
    max-height: calc(100dvh - 2 * clamp(8px, 2.5vh, 28px));
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: doneRise .45s var(--ease-spring) both;
}
@keyframes doneRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Header: tick + title side by side, logo on a white chip at the right */
.done-head {
    flex: none;
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.8vw, 18px);
    background: var(--gradient-primary);
    padding: clamp(12px, 2.6vh, 24px) clamp(16px, 3vw, 30px);
    position: relative;
    overflow: hidden;
}
.done-head::after {
    content: '';
    position: absolute;
    width: 190px; height: 190px;
    right: -70px; top: -80px;
    border-radius: 50%;
    background: rgba(255,255,255,.10);
}
.done-tick {
    flex: none;
    width: clamp(42px, 7vh, 62px); height: clamp(42px, 7vh, 62px);
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    border: 2px solid rgba(255,255,255,.45);
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.done-tick svg { width: 55%; height: 55%; }
.done-tick path {
    fill: none; stroke: #fff; stroke-width: 4;
    stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 48; stroke-dashoffset: 48;
    animation: tickDraw .5s .25s var(--ease) forwards;
}
@keyframes tickDraw { to { stroke-dashoffset: 0; } }
.done-head-text { flex: 1; min-width: 0; position: relative; }
.done-title { color: #fff; font-size: clamp(16px, calc(1.2vh + 11px), 21px); font-weight: 600; margin: 0 0 3px; line-height: 1.3; }
.done-sub { color: rgba(255,255,255,.92); font-size: clamp(11.5px, 1.5vh, 13px); margin: 0; line-height: 1.5; }
.done-brand {
    flex: none;
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 10px;
    padding: 6px 10px;
    line-height: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.done-brand img { height: clamp(22px, 3.4vh, 30px); width: auto; }

/* Body: the part that may scroll, and only inside the card */
.done-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(14px, 2.2vh, 24px) clamp(20px, 3vw, 34px);
    align-items: start;
    padding: clamp(14px, 2.6vh, 26px) clamp(16px, 3vw, 30px) clamp(10px, 1.6vh, 16px);
    scrollbar-width: thin;
    scrollbar-color: rgba(102,126,234,0.3) transparent;
}
.done-body::-webkit-scrollbar { width: 5px; }
.done-body::-webkit-scrollbar-thumb { background: rgba(102,126,234,0.3); border-radius: 4px; }
.done-col { min-width: 0; }

.done-section-label {
    font-size: 11px; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-muted);
    margin: 0 0 clamp(8px, 1.3vh, 12px);
}
.uid-box {
    display: flex; align-items: center; gap: 14px;
    background: var(--brand-bg);
    border: 1px dashed var(--sld-brand);
    border-radius: 12px;
    padding: clamp(10px, 1.7vh, 14px) 16px;
    margin-bottom: clamp(10px, 1.8vh, 16px);
}
.uid-box i.uid-icon { font-size: 18px; color: var(--brand-text); }
.uid-text { flex: 1; min-width: 0; }
.uid-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.uid-value { font-size: clamp(17px, calc(1vh + 11px), 20px); font-weight: 700; letter-spacing: .06em; color: var(--text-primary); word-break: break-all; }
.done-pill {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .02em;
    background: var(--warning-bg);
    color: var(--warning-text);
}
.done-pill:empty { display: none; }
.uid-copy {
    border: 1px solid var(--border-color); background: var(--bg-card);
    color: var(--text-secondary); border-radius: 8px;
    padding: 8px 12px; font-size: 12px; font-weight: 500;
    cursor: pointer; white-space: nowrap;
    transition: all var(--speed-fast) var(--ease);
    font-family: inherit;
}
.uid-copy:hover { border-color: var(--sld-brand); color: var(--brand-text); }
.uid-copy.copied { border-color: var(--sld-success); color: var(--sld-success); }

/* Facts: label-over-value tiles, two per row, long values across the row */
.done-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}
.fact {
    min-width: 0;
    padding: clamp(7px, 1.2vh, 11px) 14px;
    border-bottom: 1px solid var(--border-color);
}
.fact.half.left { border-right: 1px solid var(--border-color); }
.fact.wide { grid-column: 1 / -1; }
.fact.last { border-bottom: none; }
.fact .k { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; margin-bottom: 1px; }
.fact .k i { width: 12px; text-align: center; opacity: .8; }
.fact .v { font-size: 13px; font-weight: 500; color: var(--text-primary); word-break: break-word; line-height: 1.45; }

/* Next steps */
.step { display: flex; gap: 12px; align-items: flex-start; padding: clamp(7px, 1.2vh, 11px) 0; border-bottom: 1px solid var(--border-color); }
.step:last-of-type { border-bottom: none; }
.step:first-of-type { padding-top: 0; }
.step-num {
    flex: 0 0 auto; min-width: 26px; min-height: 26px; padding: 3px;
    box-sizing: border-box;
    border-radius: 50%;
    background: var(--brand-bg); color: var(--brand-text);
    font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.step-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.step-detail { font-size: 12px; color: var(--text-secondary); line-height: 1.55; }
.step-docs { margin-top: 6px; }
.step-docs summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-text);
    user-select: none;
}
.step-docs summary::-webkit-details-marker { display: none; }
.step-docs summary i { font-size: 10px; transition: transform .2s ease; }
.step-docs[open] summary i { transform: rotate(90deg); }
.step-docs ul { margin: 6px 0 0 18px; padding: 0; }
.step-docs li { font-size: 12px; color: var(--text-secondary); line-height: 1.55; }

/* Footer: the actions are always on screen */
.done-foot {
    flex: none;
    position: relative;
    transition: box-shadow .2s ease;
    padding: clamp(10px, 1.8vh, 16px) clamp(16px, 3vw, 30px) clamp(12px, 2vh, 18px);
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}
.done-actions { display: flex; gap: 10px; }
/* More of the card below the fold: a soft edge over the actions says so. */
.done-card.can-scroll .done-foot { box-shadow: 0 -10px 14px -10px rgba(15,23,42,.28); }
.btn-done {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: clamp(40px, 5.6vh, 46px); padding: 10px 16px; box-sizing: border-box; border-radius: 10px;
    font-size: 14px; font-weight: 600; font-family: inherit;
    text-decoration: none; cursor: pointer; border: 1px solid transparent;
    transition: transform var(--speed-fast) var(--ease), box-shadow var(--speed-fast) var(--ease);
}
.btn-done.primary { background: var(--gradient-primary); color: #fff; box-shadow: var(--shadow-md); }
.btn-done.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-done.ghost { flex: 0 0 auto; padding: 0 18px; background: var(--bg-card); color: var(--text-secondary); border-color: var(--border-color); }
.btn-done.ghost:hover { color: var(--brand-text); border-color: var(--sld-brand); }
[data-theme="dark"] .btn-done.primary { color: #fff; }
.done-note { margin: clamp(8px, 1.3vh, 12px) 0 0; text-align: center; font-size: 11px; color: var(--text-muted); line-height: 1.55; }
.done-note span { display: block; }

/* One column: phones in portrait (tablets and landscape phones keep two, which
   is what lets a short landscape screen hold the card) */
@media (max-width: 700px) {
    .done-card { max-width: 640px; }
    .done-body { grid-template-columns: 1fr; }
}

/* Phones: the card IS the screen */
@media (max-width: 560px) {
    .psu-done-wrap { padding: 0; align-items: stretch; }
    .done-card { max-width: none; max-height: none; height: 100vh; height: 100dvh; border-radius: 0; border: none; }
    .done-head { gap: 12px; padding: 12px 14px; }
    .done-tick { width: 40px; height: 40px; }
    .done-title { font-size: 16px; }
    .done-sub { font-size: 11.5px; }
    .done-brand { display: none; }
    .done-note { display: none; }
    .done-body { padding: 14px 14px 10px; gap: 14px; }
    .done-foot { padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)); }
    .uid-box { padding: 10px 12px; gap: 10px; }
    .fact { padding: 7px 10px; }
    .btn-done.ghost { padding: 0 14px; }
}
@media (max-width: 340px) {
    .done-facts { grid-template-columns: 1fr; }
    .fact.half.left { border-right: none; }
}

/* Short screens (laptops at 125-150 % scaling, landscape phones): trim what is decoration */
@media (max-height: 700px) {
    .done-note span { display: none; }
}
@media (max-height: 560px) {
    .done-note { display: none; }
    .done-sub { display: none; }
    .done-section-label { margin-bottom: 6px; }
}
@media (max-height: 460px) and (min-width: 561px) {
    .done-head { padding-top: 8px; padding-bottom: 8px; }
    .done-tick { width: 34px; height: 34px; }
}

@media print {
    body.psu-page { background: #fff; display: block; }
    body.psu-page::before, .psu-back, .flash-toast-container { display: none !important; }
    .psu-done-wrap { padding: 0; min-height: 0; display: block; }
    .done-card { box-shadow: none; border: none; max-width: none; max-height: none; height: auto; display: block; }
    .done-body { overflow: visible; display: block; }
    .done-col + .done-col { margin-top: 18px; }
    .done-head { background: #fff !important; }
    .done-title, .done-sub { color: #000 !important; }
    .done-tick, .done-brand { display: none; }
    .done-foot, .uid-copy { display: none !important; }
}
