/* TN Auth v6.0 */
.tnauth-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 99999;
    display: flex; align-items: center; justify-content: center;
}
.tnauth-modal {
    background: #fff; border-radius: 14px; padding: 36px 32px;
    width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    font-family: sans-serif; box-sizing: border-box;
    max-height: 90vh; overflow-y: auto;
    animation: tnauth-modal-in .25s cubic-bezier(.16,1,.3,1);
}
@keyframes tnauth-modal-in {
    from { opacity:0; transform: translateY(24px) scale(.97); }
    to   { opacity:1; transform: translateY(0) scale(1); }
}
.tnauth-modal h2 { margin: 0 0 6px; font-size: 1.4rem; color: #111; }
.tnauth-sub { color: #666; font-size: .9rem; margin: 0 0 20px; }
.tnauth-modal input[type=email],
.tnauth-modal input[type=text],
.tnauth-modal input[type=number],
.tnauth-modal input[type=tel],
.tnauth-modal select {
    width: 100%; padding: 11px 14px; border: 1.5px solid #ddd;
    border-radius: 8px; font-size: .95rem; margin-bottom: 12px;
    box-sizing: border-box; outline: none; transition: border-color .2s;
    color: #111 !important; background: #fff !important;
}
.tnauth-modal input:focus,
.tnauth-modal input:active,
.tnauth-modal select:focus,
.tnauth-modal select:active { border-color: #111; color: #111 !important; background: #fff !important; }
.tnauth-modal input::placeholder { color: #aaa; }
.tnauth-btn {
    width: 100%; padding: 12px; background: #111; color: #fff;
    border: none; border-radius: 8px; font-size: 1rem;
    cursor: pointer; margin-top: 4px; transition: opacity .2s, transform .15s;
}
.tnauth-btn:hover { opacity: .88; }
.tnauth-btn:active { transform: scale(.98); }
.tnauth-btn:disabled { opacity: .6; cursor: not-allowed; }
.tnauth-error { color: #c00; font-size: .85rem; min-height: 18px; margin: 6px 0 0; }

.tnauth-tos-label {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: .82rem; color: #444; line-height: 1.45; cursor: pointer;
}
.tnauth-tos-label--inline { margin-top: 10px; margin-bottom: 2px; }
.tnauth-tos-label input[type="checkbox"] {
    width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; accent-color: #111;
}
.tnauth-tos-label a { color: #111; font-weight: 700; text-decoration: underline; }
.tnauth-tos-label a:hover { opacity: .85; }
.tnauth-otp-inputs { display: flex; gap: 8px; margin-bottom: 16px; }
.tnauth-otp-digit {
    flex: 1; text-align: center !important; font-size: 1.4rem !important;
    padding: 10px 0 !important; border: 1.5px solid #ddd !important;
    border-radius: 8px !important; margin-bottom: 0 !important;
    transition: border-color .15s, transform .1s !important;
    color: #111 !important; background: #fff !important;
}
.tnauth-otp-digit:focus { border-color: #111 !important; color: #111 !important; background: #fff !important; }
.tnauth-otp-digit.filled { border-color: #111 !important; transform: scale(1.05); }
.tnauth-resend { font-size: .85rem; color: #666; margin-top: 10px; }
.tnauth-resend a { color: #111; font-weight: 600; text-decoration: none; }
.tnauth-row { display: flex; gap: 10px; }
.tnauth-row input { flex: 1; }
.tnauth-phone-wrap { display: flex; gap: 8px; }
.tnauth-phone-wrap #tnauth-phone-prefix { width: 72px; flex: none; }
.tnauth-phone-wrap #tnauth-phone-number { flex: 1; }
.tnauth-field-label { font-size: .85rem; font-weight: 600; color: #444; margin-bottom: 8px; }
.tnauth-multi-hint { font-weight: 400; color: #888; }
.tnauth-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tnauth-checkboxes label {
    border: 1.5px solid #bbb; border-radius: 20px; padding: 6px 14px;
    cursor: pointer; font-size: .85rem; user-select: none; transition: all .15s;
    color: #111 !important; background: #fff;
}
.tnauth-checkboxes label.selected { background: #111 !important; color: #fff !important; border-color: #111; }
.tnauth-checkboxes input { display: none; }

/* ── Payment Selection ── */
#tnauth-payment-section { margin: 0 0 20px; }
.tnauth-payment-title { font-size: 1rem; font-weight: 700; color: #e0e0e0; margin: 0 0 12px; }
.tnauth-payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px; margin-bottom: 10px;
}
.tnauth-payment-card {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 5px; padding: 14px 8px;
    border: 2px solid rgba(255,255,255,.12); border-radius: 10px;
    cursor: pointer; background: rgba(255,255,255,.06); color: #e0e0e0;
    transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
    user-select: none;
}
.tnauth-payment-card:hover {
    border-color: rgba(177,77,0,.55);
    background: rgba(177,77,0,.1);
    box-shadow: 0 4px 14px rgba(177,77,0,.18);
    transform: translateY(-2px);
    color: #fff;
}
.tnauth-payment-card.selected {
    border-color: #B14D00;
    background: rgba(177,77,0,.22);
    color: #fff;
    box-shadow: 0 6px 22px rgba(177,77,0,.35);
    transform: translateY(-3px);
}
.tnauth-payment-icon  { font-size: 1.5rem; line-height: 1; display: flex; align-items: center; justify-content: center; min-height: 44px; }
.tnauth-payment-icon--img img {
    width: 44px; height: 44px; object-fit: contain;
    display: block; border-radius: 8px; background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.tnauth-payment-card.selected .tnauth-payment-icon--img img {
    background: #fff;
    box-shadow: 0 2px 10px rgba(177,77,0,.3);
}
.tnauth-payment-label { font-size: .78rem; font-weight: 600; text-align: center; color: inherit; }
.tnauth-payment-fee   { font-size: .68rem; color: rgba(255,255,255,.5); }
.tnauth-payment-card.selected .tnauth-payment-fee { color: rgba(255,220,180,.8); }

/* ── TTC Preview ── */
#tnauth-ttc-preview {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(177,77,0,.12); border: 1px solid rgba(177,77,0,.3); border-radius: 8px; padding: 10px 14px;
    margin-bottom: 8px; animation: tnauth-fadein .2s ease;
}
@keyframes tnauth-fadein { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
.tnauth-ttc-label  { font-size: .85rem; color: rgba(255,255,255,.6); }
.tnauth-ttc-amount { font-size: 1.1rem; font-weight: 700; color: #ffb366; }

/* ── Place Order pulse ── */
@keyframes tnauth-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(0,0,0,.3); }
    70%  { box-shadow: 0 0 0 10px rgba(0,0,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}
.tnauth-btn-pulse { animation: tnauth-pulse .6s ease; }

/* ── Thank You ── */
.tnauth-thankyou {
    background: #f9f9f9; border: 1px solid #e5e5e5; border-radius: 12px;
    padding: 28px 24px; margin-bottom: 24px; text-align: center;
}
.tnauth-ty-icon  { font-size: 2.5rem; margin-bottom: 8px; }
.tnauth-thankyou h2 { margin: 0 0 12px; font-size: 1.4rem; color: #111; }
.tnauth-ty-inv   { font-size: 1rem; color: #333; margin-bottom: 6px; }
.tnauth-ty-note  { font-size: .85rem; color: #666; margin-top: 12px; }

@media (max-width: 480px) {
    .tnauth-modal { padding: 28px 20px; margin: 16px; }
    .tnauth-row { flex-direction: column; gap: 0; }
    .tnauth-payment-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Account page router + dashboard ── */

.tnauth-account { max-width: 920px; margin: 0 auto; padding: 24px 16px 48px; font-family: 'Segoe UI', system-ui, sans-serif; }
.tnauth-account--guest { text-align: center; padding: 40px 16px; }
.tnauth-account-inner h1 { font-size: 1.75rem; margin: 0 0 8px; color: #111; }
.tnauth-account-inner h2 { font-size: 1.15rem; margin: 0 0 14px; color: #222; }
.tnauth-account-inner h3 { font-size: 1rem; margin: 24px 0 10px; color: #333; }
.tnauth-card {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    padding: 22px 24px;
    margin-bottom: 20px;
    box-sizing: border-box;
}
.tnauth-welcome { background: linear-gradient(145deg, #fff, #f6f6f6); border-color: #ddd; }
.tnauth-muted { color: #666; font-size: 0.92rem; line-height: 1.6; margin: 0; }
.tnauth-alert {
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 0.92rem;
}
.tnauth-alert-warn { background: #fff8e6; border: 1px solid #f0d090; color: #5c4a20; }
.tnauth-kv { list-style: none; margin: 0; padding: 0; }
.tnauth-kv li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid #eee; }
.tnauth-kv li:last-child { border-bottom: none; }
.tnauth-kv span { color: #666; }
.tnauth-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tnauth-table th, .tnauth-table td { border: 1px solid #e5e5e5; padding: 10px 8px; text-align: left; }
.tnauth-table th { background: #f0f0f0; font-weight: 700; }
.tnauth-btn-inline {
    display: inline-block;
    padding: 6px 12px;
    background: #111;
    color: #fff !important;
    border-radius: 6px;
    text-decoration: none !important;
    font-size: 0.82rem;
    font-weight: 600;
    margin-right: 6px;
}
.tnauth-link { color: #ff6b00; font-weight: 600; text-decoration: none; }
.tnauth-pill {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #ececec;
    color: #333;
    font-size: 0.75rem;
    font-weight: 600;
}
.tnauth-pill-info {
    background: #e9f3ff;
    color: #1959a8;
}
.tnauth-pill-warn {
    background: #fff0d9;
    color: #8a5a00;
}
.tnauth-ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 16px 0; }
.tnauth-ref-code, .tnauth-ref-link {
    word-break: break-all;
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    margin: 6px 0;
}
.tnauth-stat-label { display: block; font-size: 0.78rem; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: 0.04em; }
.tnauth-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin: 20px 0; }
.tnauth-metric { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 12px; text-align: center; }
.tnauth-metric strong { display: block; font-size: 1.25rem; margin-top: 4px; color: #111; }
.tnauth-future-note { font-size: 0.85rem; color: #777; margin-top: 16px; }
.tnauth-account-loading { text-align: center; padding: 40px; color: #666; }
.tnauth-account-auth {
    max-width: 520px;
    margin: 0 auto;
    text-align: left;
}
.tnauth-account-auth input,
.tnauth-account-auth select {
    width: 100%;
    margin-bottom: 10px;
    box-sizing: border-box;
}

/* ── Standalone signup shortcode [tnauth_signup] ───────────────────────── */
/* Force LTR layout (flex row order, phone prefix + number, OTP boxes) even on RTL sites */
.tnauth-signup-wrap,
.tnauth-signup-wrap .tnauth-modal {
    direction: ltr;
    unicode-bidi: isolate;
}
.tnauth-signup-wrap .tnauth-modal {
    text-align: left;
}
.tnauth-signup-wrap {
    max-width: 460px;
    margin: 0 auto 24px;
}
.tnauth-signup-modal {
    margin: 0 auto;
}
.tnauth-phone-wrap #tnauth-su-phone-prefix {
    width: 72px;
    flex: none;
}
.tnauth-phone-wrap #tnauth-su-phone-number {
    flex: 1;
}
.tnauth-signup-logged-in {
    text-align: center;
}
.tnauth-signup-notice {
    margin: 0 0 12px;
    color: #444;
    font-size: 0.95rem;
}
a.tnauth-signup-shop-link {
    display: inline-block;
    width: auto;
    min-width: 200px;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
}
.tnauth-su-redirect-hint {
    font-size: 0.88rem;
    color: #666;
    margin: 12px 0 0;
}
