/*
 * Payscribe — Auth Pages Stylesheet
 * Font already loaded globally via your layout:
 *   <link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&display=swap" rel="stylesheet">
 *
 * Load this file in each auth view:
 *   <link rel="stylesheet" href="<?= base_url('assets/css/auth.css') ?>">
 */

/* ── Tokens ────────────────────────────────────────────────────────────────── */
:root {
    --au-ink:       #0e1a2b;
    --au-ink-2:     #3a4a5c;
    --au-ink-3:     #7a8a99;
    --au-gold:      #c07c2e;
    --au-gold-lt:   #fdf3e7;
    --au-cream:     #f8f5f0;
    --au-border:    #e6e1d9;
    --au-white:     #ffffff;
    --au-success:   #1a6e40;
    --au-error:     #9b2626;
    --au-warn:      #7a5c10;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--au-ink);
    background: var(--au-cream);
}

/* ── Page layout ───────────────────────────────────────────────────────────── */
.au-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ── Left panel ────────────────────────────────────────────────────────────── */
.au-left {
    background: var(--au-ink);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 2.75rem 2.5rem;
}

.au-left-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: .12;
}

.au-left-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.au-left-lines svg { width: 100%; height: 100%; }

.au-left-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.au-logo { margin-bottom: auto; }
.au-logo img { height: 30px; width: auto; }

.au-headline { margin-top: auto; padding-bottom: .5rem; }

.au-headline h1 {
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(1.6rem, 2.5vw, 2.4rem);
    color: #fff;
    line-height: 1.22;
    margin-bottom: .85rem;
    font-weight: 700;
}
.au-headline h1 em {
    font-style: italic;
    color: #d4a86a;
    font-weight: 300;
}
.au-headline p {
    font-size: .8125rem;
    color: rgba(255, 255, 255, .38);
    line-height: 1.75;
    max-width: 320px;
    font-weight: 400;
}

/* Trust badges */
.au-trust {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, .07);
}
.au-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: rgba(255, 255, 255, .28);
    font-weight: 600;
    letter-spacing: .01em;
}
.au-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #3dbf7a;
    flex-shrink: 0;
}
.au-badge-sep { color: rgba(255, 255, 255, .1); font-size: 10px; }

/* ── Right panel ───────────────────────────────────────────────────────────── */
.au-right {
    background: var(--au-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
}

.au-form-wrap {
    width: 100%;
    max-width: 360px;
}

/* ── Step dots (create page) ───────────────────────────────────────────────── */
.au-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 1.75rem;
}
.au-dot {
    width: 24px; height: 3px;
    border-radius: 2px;
    background: var(--au-border);
    transition: background .25s;
}
.au-dot.active { background: var(--au-gold); }
.au-dot.done   { background: var(--au-ink); }
.au-dot-label {
    font-size: 11px;
    color: var(--au-ink-3);
    margin-left: 5px;
    font-weight: 600;
}
.au-dot-label span { color: var(--au-ink); font-weight: 700; }

/* ── Panel heading ─────────────────────────────────────────────────────────── */
.au-head { margin-bottom: 1.75rem; }

.au-head h2 {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--au-ink);
    margin-bottom: .3rem;
    line-height: 1.2;
}
.au-head p {
    font-size: .8125rem;
    color: var(--au-ink-3);
    line-height: 1.65;
    margin: 0;
    font-weight: 400;
}

/* ── Form fields ───────────────────────────────────────────────────────────── */
.au-field { margin-bottom: 1rem; }

.au-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--au-ink);
    margin-bottom: .35rem;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.au-field input,
.au-field select,
.au-field textarea {
    width: 100%;
    border: 1.5px solid var(--au-border);
    border-radius: 8px;
    padding: .625rem .85rem;
    font-size: 13.5px;
    font-family: 'Nunito Sans', sans-serif;
    color: var(--au-ink);
    background: var(--au-white);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
    font-weight: 400;
}
.au-field input:focus,
.au-field select:focus,
.au-field textarea:focus {
    border-color: var(--au-ink);
    box-shadow: 0 0 0 3px rgba(14, 26, 43, .06);
}
.au-field input::placeholder,
.au-field textarea::placeholder {
    color: var(--au-ink-3);
    font-weight: 400;
}
.au-field .au-hint {
    font-size: 11.5px;
    color: var(--au-ink-3);
    margin-top: 4px;
    font-weight: 400;
}

/* Error state */
.au-field.has-error input,
.au-field.has-error select { border-color: var(--au-error); }
.au-field-err {
    font-size: 11.5px;
    color: var(--au-error);
    margin-top: 4px;
    display: none;
    font-weight: 600;
}
.au-field.has-error .au-field-err { display: block; }

/* Select arrow */
.au-select-wrap { position: relative; }
.au-select-wrap select { padding-right: 2rem; }
.au-select-wrap::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--au-ink-3);
    pointer-events: none;
}

/* Phone row */
.au-phone-row { display: grid; grid-template-columns: 120px 1fr; gap: 8px; }

/* Email verify row */
.au-email-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.au-btn-verify {
    background: var(--au-cream);
    border: 1.5px solid var(--au-border);
    border-radius: 8px;
    padding: .625rem .9rem;
    font-size: 12px;
    font-weight: 700;
    color: var(--au-ink);
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    font-family: 'Nunito Sans', sans-serif;
}
.au-btn-verify:hover { background: var(--au-border); }
.au-btn-verify.verified {
    border-color: var(--au-success);
    color: var(--au-success);
    background: #f0fbf5;
    cursor: default;
}

/* ── Account type cards (create page) ──────────────────────────────────────── */
.au-type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 1rem; }
.au-type-card {
    border: 1.5px solid var(--au-border);
    border-radius: 9px;
    padding: .8rem .85rem;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    position: relative;
    user-select: none;
}
.au-type-card:hover { border-color: rgba(14, 26, 43, .3); }
.au-type-card.selected { border-color: var(--au-ink); background: #f5f7fa; }

.au-type-card-icon {
    width: 30px; height: 30px;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    margin-bottom: .5rem;
    background: var(--au-cream);
}
.au-type-card.selected .au-type-card-icon { background: var(--au-gold-lt); }
.au-type-card strong { display: block; font-size: 12.5px; font-weight: 700; color: var(--au-ink); margin-bottom: 2px; }
.au-type-card p { font-size: 10.5px; color: var(--au-ink-3); line-height: 1.4; margin: 0; font-weight: 400; }

.au-type-check {
    position: absolute;
    top: 8px; right: 8px;
    width: 15px; height: 15px;
    border-radius: 50%;
    border: 1.5px solid var(--au-border);
    transition: all .15s;
}
.au-type-card.selected .au-type-check { background: var(--au-ink); border-color: var(--au-ink); }
.au-type-card.selected .au-type-check::after {
    content: '';
    display: block;
    width: 4px; height: 2.5px;
    border-left: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
    transform: rotate(-45deg) translate(4px, 3px);
}

/* Registered toggle */
.au-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: .75rem; }
.au-toggle-opt {
    border: 1.5px solid var(--au-border);
    border-radius: 8px;
    padding: .6rem .8rem;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--au-ink-3);
    text-align: center;
    transition: all .15s;
    user-select: none;
}
.au-toggle-opt.selected { border-color: var(--au-ink); color: var(--au-ink); background: #f5f7fa; }

/* Optional tag */
.au-opt-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--au-ink-3);
    background: var(--au-cream);
    border: 1px solid var(--au-border);
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 5px;
    text-transform: none;
    letter-spacing: 0;
    vertical-align: middle;
}

/* ── Password strength ─────────────────────────────────────────────────────── */
.au-pw-bar { display: flex; gap: 3px; margin-top: 6px; }
.au-pw-seg { height: 3px; flex: 1; border-radius: 2px; background: var(--au-border); transition: background .2s; }
.au-pw-label { font-size: 11px; color: var(--au-ink-3); margin-top: 3px; min-height: 16px; font-weight: 600; }
.au-pw-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; margin-top: 7px; }
.au-pw-item {
    font-size: 11px;
    color: var(--au-ink-3);
    display: flex; align-items: center; gap: 5px;
    font-weight: 400;
}
.au-pw-item::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--au-border);
    flex-shrink: 0;
    transition: background .2s;
}
.au-pw-item.ok { color: var(--au-success); }
.au-pw-item.ok::before { background: var(--au-success); }

/* ── OTP inputs (verify page) ──────────────────────────────────────────────── */
.au-otp-group { display: flex; gap: 9px; justify-content: center; margin-bottom: .5rem; }
.au-otp-input {
    width: 48px; height: 54px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    border: 1.5px solid var(--au-border);
    border-radius: 8px;
    color: var(--au-ink);
    font-family: 'Nunito Sans', sans-serif;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.au-otp-input:focus {
    border-color: var(--au-ink);
    box-shadow: 0 0 0 3px rgba(14, 26, 43, .06);
}
.au-otp-sep {
    font-size: 1.2rem;
    color: var(--au-ink-3);
    align-self: center;
    padding: 0 2px;
}

/* ── Remember me / checkbox row ────────────────────────────────────────────── */
.au-check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.au-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--au-ink-3);
    user-select: none;
    font-weight: 400;
}
.au-check-label input[type=checkbox] {
    width: 15px; height: 15px;
    accent-color: var(--au-ink);
    cursor: pointer;
}
.au-forgot-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--au-ink);
    text-decoration: none;
}
.au-forgot-link:hover { text-decoration: underline; }

/* Terms */
.au-terms-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 1.25rem;
}
.au-terms-row input[type=checkbox] {
    width: 16px; height: 16px;
    accent-color: var(--au-ink);
    cursor: pointer;
    margin-top: 1px;
    flex-shrink: 0;
}
.au-terms-row p { font-size: 12.5px; color: var(--au-ink-3); line-height: 1.55; margin: 0; font-weight: 400; }
.au-terms-row a { color: var(--au-ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--au-border); }

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.au-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: 13px;
    margin-bottom: 1.1rem;
    line-height: 1.5;
}
.au-alert strong { display: block; font-weight: 700; margin-bottom: 2px; }
.au-alert p { margin: 0; font-size: 12px; opacity: .85; font-weight: 400; }

.au-alert.warn {
    background: #fffbf0;
    border: 1px solid #f0d98a;
    color: var(--au-warn);
}
.au-alert.error {
    background: #fff5f5;
    border: 1px solid #f5c6c6;
    color: var(--au-error);
}
.au-alert.success {
    background: #f0fbf5;
    border: 1px solid #9fdfc0;
    color: var(--au-success);
}
.au-alert.info {
    background: #f0f6ff;
    border: 1px solid #c6daf5;
    color: #2a4a7f;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.au-btn-primary {
    width: 100%;
    background: var(--au-ink);
    color: var(--au-white);
    border: none;
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Nunito Sans', sans-serif;
    cursor: pointer;
    transition: background .15s, transform .1s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    letter-spacing: -.01em;
    text-decoration: none;
}
.au-btn-primary:hover  { background: #1e2f44; color: #fff; }
.au-btn-primary:active { transform: scale(.99); }
.au-btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.au-back {
    background: none;
    border: none;
    color: var(--au-ink-3);
    font-size: 13px;
    font-family: 'Nunito Sans', sans-serif;
    cursor: pointer;
    padding: 0;
    display: inline-flex; align-items: center; gap: 5px;
    font-weight: 600;
}
.au-back:hover { color: var(--au-ink); }

.au-nav { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem; }

/* Spinner */
.au-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: au-spin .6s linear infinite;
    display: none;
    flex-shrink: 0;
}
.au-btn-primary.loading .au-spinner { display: block; }
.au-btn-primary.loading .au-btn-label { opacity: .65; }
@keyframes au-spin { to { transform: rotate(360deg); } }

/* ── Divider ───────────────────────────────────────────────────────────────── */
.au-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 1rem 0;
    font-size: 12px;
    color: var(--au-ink-3);
    font-weight: 600;
}
.au-divider::before, .au-divider::after { content: ''; flex: 1; height: 1px; background: var(--au-border); }

/* ── Footer link ───────────────────────────────────────────────────────────── */
.au-footer-link {
    text-align: center;
    margin-top: 1.4rem;
    font-size: 13px;
    color: var(--au-ink-3);
    font-weight: 400;
}
.au-footer-link a { color: var(--au-ink); font-weight: 700; text-decoration: none; }
.au-footer-link a:hover { text-decoration: underline; }

/* ── Personal app screen (create page) ─────────────────────────────────────── */
.au-personal { text-align: center; padding: .5rem 0; }
.au-personal-icon {
    width: 48px; height: 48px;
    background: var(--au-gold-lt);
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    margin: 0 auto 1.1rem;
}
.au-personal h3 {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--au-ink);
    margin-bottom: .4rem;
}
.au-personal p {
    font-size: 13px;
    color: var(--au-ink-3);
    line-height: 1.65;
    margin-bottom: 1.25rem;
    max-width: 280px;
    margin-left: auto; margin-right: auto;
    font-weight: 400;
}

/* ── Panel animation ───────────────────────────────────────────────────────── */
.au-panel { display: none; }
.au-panel.active { display: block; animation: au-in .22s ease; }
@keyframes au-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .au-page { grid-template-columns: 1fr; }
    .au-left { display: none; }
    .au-right { padding: 2rem 1.25rem; align-items: flex-start; padding-top: 2.5rem; }
    .au-type-cards { grid-template-columns: 1fr; }
    .au-pw-checks { grid-template-columns: 1fr; }
    .au-otp-group { gap: 7px; }
    .au-otp-input { width: 42px; height: 48px; font-size: 1.2rem; }
    .au-phone-row { grid-template-columns: 100px 1fr; }
}

/* ── Account cards ─────────────────────────────────────────────────────────── */
.acct-card {
    border: 1.5px solid var(--au-border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
    margin-bottom: .75rem;
    position: relative;
    user-select: none;
    background: #fff;
}
.acct-card:hover { border-color: rgba(14,26,43,.3); box-shadow: 0 2px 8px rgba(14,26,43,.05); }
.acct-card.is-selected { border-color: var(--au-ink); background: #f7f9fb; box-shadow: 0 2px 8px rgba(14,26,43,.07); }
.acct-card.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* Radio indicator */
.acct-radio {
    position: absolute;
    top: 1.05rem; right: 1rem;
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--au-border);
    transition: all .15s;
    flex-shrink: 0;
}
.acct-card.is-selected .acct-radio { background: var(--au-ink); border-color: var(--au-ink); }
.acct-card.is-selected .acct-radio::after {
    content: '';
    display: block;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #fff;
    margin: 4px auto 0;
}

/* Card header row */
.acct-header { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; padding-right: 1.5rem; }
.acct-avatar {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: var(--au-cream);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--au-ink);
    flex-shrink: 0;
    font-family: 'Nunito Sans', sans-serif;
    letter-spacing: -.01em;
    border: 1px solid var(--au-border);
}
.acct-card.is-selected .acct-avatar { background: #eef2f8; border-color: rgba(14,26,43,.15); }

.acct-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--au-ink);
    line-height: 1.3;
}
.acct-name.is-empty { color: var(--au-ink-3); font-weight: 600; font-style: italic; }

/* Badges */
.acct-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.badge-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10.5px; font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: .01em;
    font-family: 'Nunito Sans', sans-serif;
}
.badge-active   { background: #e7f7ef; color: #1a6e40; }
.badge-pending  { background: #fff8e6; color: #7a5c10; }
.badge-review   { background: #e8f0ff; color: #2a4a8f; }
.badge-setup    { background: #f3f3f3; color: #7a8a99; }
.badge-access   { background: #f0eeff; color: #5040a0; }
.badge-dot      { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.badge-active  .badge-dot { background: #1a6e40; }
.badge-pending .badge-dot { background: #c09030; }
.badge-review  .badge-dot { background: #4060c0; }

/* Products row */
.acct-products {
    font-size: 11.5px;
    color: var(--au-ink-3);
    margin-top: 5px;
    line-height: 1.5;
    font-weight: 400;
}
.acct-hint {
    font-size: 11.5px;
    color: var(--au-ink-3);
    margin-top: 4px;
    display: flex; align-items: center; gap: 5px;
    font-weight: 400;
}
.acct-hint::before {
    content: '→';
    font-size: 10px;
    color: var(--au-gold);
    font-weight: 700;
}

/* Proceed button area */
.proceed-wrap { margin-top: 1.25rem; }

.status-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin: 0 auto 1.25rem;
}
.status-icon.pending  { background: #fff8e6; }
.status-icon.approved { background: #e7f7ef; }
.status-icon.rejected { background: #fff0f0; }

.ref-box {
    background: var(--au-cream);
    border: 1px solid var(--au-border);
    border-radius: 9px;
    padding: 1rem 1.1rem;
    margin: 1.5rem 0;
}
.ref-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .45rem 0;
    border-bottom: 1px solid var(--au-border);
    font-size: 13px;
}
.ref-row:last-child { border-bottom: none; }
.ref-row span:first-child { color: var(--au-ink-3); font-weight: 400; }
.ref-row span:last-child  { color: var(--au-ink);   font-weight: 700; }

.step-list { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.step-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: .55rem 0;
    font-size: 13px;
    color: var(--au-ink-2);
    position: relative;
}
.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 10px; top: 30px;
    width: 1px; height: calc(100% - 10px);
    background: var(--au-border);
}
.step-dot {
    width: 21px; height: 21px;
    border-radius: 50%;
    border: 1.5px solid var(--au-border);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px;
    font-weight: 700;
    background: #fff;
    position: relative; z-index: 1;
}
.step-dot.done  { background: var(--au-ink); border-color: var(--au-ink); color: #fff; }
.step-dot.active{ background: #fff8e6; border-color: #c9a83a; color: #7a5a10; }

.pulse {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #c9a83a;
    animation: pulse 1.6s ease-in-out infinite;
    margin-right: 6px;
    vertical-align: middle;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .4; transform: scale(.75); }
}

.divider-line {
    border: none;
    border-top: 1px solid var(--au-border);
    margin: 1.25rem 0;
}