/* ============================================================
   auth.css — ImageSlip Auth Pages Shared Stylesheet
   ============================================================ */

* { box-sizing: border-box; }

/* ── RaceResult ID tooltip ── */
.rr-tip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.rr-tip-icon {
    color: #94a3b8;
    font-size: 13px;
    cursor: default;
    line-height: 1;
}
.rr-tip-box {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    background: #1e293b;
    color: #f1f5f9;
    font-size: 11.5px;
    font-weight: 400;
    padding: 7px 12px;
    border-radius: 7px;
    white-space: normal;
    width: 240px;
    text-align: center;
    line-height: 1.5;
    pointer-events: none;
    z-index: 99;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.rr-tip-box::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
}
.rr-tip-wrap:hover .rr-tip-box { display: block; }
body { font-family: 'Nunito', 'Noto Sans Thai', sans-serif; margin: 0; }

/* ── Body layout variants ── */
body.auth-split    { background: #fff; }
body.auth-card-page {
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Form controls ── */
.field-label { font-size: 13px; font-weight: 700; color: #374151; display: block; margin-bottom: 6px; }
.field-wrap { position: relative; margin-bottom: 16px; }
.field-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 14px; }
.field-input {
    width: 100%; background: #f8fafc; border: 1.5px solid #e2e8f0;
    border-radius: 10px; padding: 12px 14px 12px 40px;
    font-size: 14px; color: #0f172a; outline: none;
    transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
.field-input::placeholder { color: #cbd5e1; }
.field-input:focus { border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,0.1); background: #fff; }
.field-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-submit {
    width: 100%;
    background: #f97316;
    color: #fff; border: none;
    border-radius: 6px; padding: 13px; font-size: 14px; font-weight: 700;
    cursor: pointer; font-family: inherit;
    transition: background-color .15s ease;
    box-shadow: none;
}
.btn-submit:hover { background: #ea580c; }
.form-title { font-size: 20px; font-weight: 900; color: #0f172a; margin-bottom: 4px; }
.form-subtitle, .form-sub { font-size: 13px; color: #94a3b8; margin-bottom: 24px; line-height: 1.5; }
.form-footer { text-align: center; font-size: 13px; color: #94a3b8; margin-top: 24px; }
.form-footer a { color: #f97316; font-weight: 700; text-decoration: none; }
.form-footer a:hover { text-decoration: underline; }
.alert { border-radius: 10px; padding: 11px 14px; font-size: 13px; margin-bottom: 18px; display: flex; align-items: flex-start; gap: 9px; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }
.back-link { display: block; text-align: center; margin-top: 20px; font-size: 12px; color: #94a3b8; text-decoration: none; }
.back-link:hover { color: #0f172a; }
.divider { height: 1px; background: #f1f5f9; margin-bottom: 10px; }

/* ── Split layout (signin / signup) ── */
.layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
@media (max-width: 860px) {
    .layout { grid-template-columns: 1fr; }
    .brand-panel { display: none; }
    .form-panel { padding: 48px 24px; }
}
.brand-panel {
    background: #0f172a; display: flex; flex-direction: column; justify-content: space-between;
    padding: 48px 52px; min-height: 100vh; position: relative; overflow: hidden;
}
.brand-panel::before {
    content: ''; position: absolute; top: -120px; right: -120px;
    width: 380px; height: 380px; border-radius: 50%;
    background: rgba(249,115,22,0.08); pointer-events: none;
}
.brand-panel::after {
    content: ''; position: absolute; bottom: -80px; left: -80px;
    width: 280px; height: 280px; border-radius: 50%;
    background: rgba(249,115,22,0.05); pointer-events: none;
}
.brand-logo-icon { width: 40px; height: 40px; border-radius: 10px; background: #f97316; display: flex; align-items: center; justify-content: center; }
.brand-logo-name { font-size: 20px; font-weight: 900; color: #fff; }
.brand-logo-tag  { font-size: 11px; color: rgba(249,115,22,0.8); font-weight: 600; }
.brand-headline  { font-size: 36px; font-weight: 900; color: #fff; line-height: 1.2; margin: 0 0 16px; }
.brand-headline span { color: #f97316; }
.brand-sub { font-size: 15px; color: rgba(255,255,255,0.5); line-height: 1.6; margin: 0 0 36px; }
.brand-feature { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.brand-feature-icon {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    background: rgba(249,115,22,0.12); border: 1px solid rgba(249,115,22,0.2);
    display: flex; align-items: center; justify-content: center;
    color: #f97316; font-size: 13px; margin-top: 1px;
}
.brand-feature-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.brand-feature-desc  { font-size: 12px; color: rgba(255,255,255,0.4); }
.form-panel { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 40px 24px; background: #fff; }
.form-wrap  { width: 100%; max-width: 380px; }
.auth-tabs  { display: flex; background: #f1f5f9; border-radius: 12px; padding: 4px; margin-bottom: 28px; }
.auth-tab   { flex: 1; text-align: center; padding: 10px; border-radius: 9px; font-size: 14px; font-weight: 700; cursor: pointer; color: #94a3b8; text-decoration: none; transition: all .15s; }
.auth-tab.active { background: #fff; color: #0f172a; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

/* ── Card layout (forgot-password / admin login) ── */
.auth-card {
    background: #fff; border-radius: 16px; padding: 40px 36px;
    width: 100%; max-width: 380px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
}
.logo-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.logo-icon { width: 38px; height: 38px; border-radius: 9px; background: #0f172a; display: flex; align-items: center; justify-content: center; }
.logo-name { font-size: 16px; font-weight: 900; color: #0f172a; }
.logo-sub  { font-size: 11px; color: #94a3b8; font-weight: 600; }

/* ── Country searchable select (signup) ── */
.cs-select { position: relative; }
.cs-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; cursor: pointer; background: #f8fafc; }
.cs-trigger:focus { border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,0.1); background: #fff; }
.cs-label { color: #cbd5e1; }
.cs-label.has-value { color: #0f172a; }
.cs-caret { color: #94a3b8; font-size: 12px; transition: transform .15s; }
.cs-select.open .cs-caret { transform: rotate(180deg); }
.cs-panel {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12); display: none; overflow: hidden;
}
.cs-select.open .cs-panel { display: block; }
.cs-search-wrap { position: relative; padding: 8px; border-bottom: 1px solid #f1f5f9; }
.cs-search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 12px; }
.cs-search { width: 100%; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 8px 10px 8px 32px; font-size: 13px; outline: none; font-family: inherit; color: #0f172a; }
.cs-search:focus { border-color: #f97316; }
.cs-list { list-style: none; margin: 0; padding: 4px; max-height: 220px; overflow-y: auto; }
.cs-option { padding: 9px 12px; font-size: 14px; color: #374151; border-radius: 7px; cursor: pointer; }
.cs-option:hover, .cs-option.active { background: #fff7ed; color: #ea580c; }
.cs-option.selected { background: #f97316; color: #fff; font-weight: 700; }
.cs-empty { padding: 16px; text-align: center; font-size: 13px; color: #94a3b8; }
.cs-list::-webkit-scrollbar { width: 8px; }
.cs-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

/* ── Admin login overrides (scoped to body.auth-admin-login) ── */
body.auth-admin-login .auth-card { padding: 20px; }
body.auth-admin-login .field-input { padding-right: 44px; }
body.auth-admin-login .field-input:focus { border-color: #0f172a; box-shadow: 0 0 0 3px rgba(15,23,42,0.08); }
body.auth-admin-login .toggle-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #94a3b8; padding: 4px; font-size: 13px; }
body.auth-admin-login .toggle-btn:hover { color: #0f172a; }
body.auth-admin-login .btn-submit { background: #0f172a; }
body.auth-admin-login .btn-submit:hover { background: #1e293b; }
.admin-access-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: #94a3b8; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 3px 8px; margin-bottom: 10px; }
.admin-access-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }

/* ── Panel-class fallbacks (used by reset-password and other pages that load auth-head) ── */
.form-label { display: block; font-size: 12px; font-weight: 800; color: #64748b; margin-bottom: 6px; }
.form-input {
    width: 100%; background: #f7f8fb;
    border: 1.5px solid #e5e8f0;
    border-radius: 10px; padding: 10px 14px;
    font-size: 13.5px; color: #1e293b; outline: none; font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.form-input::placeholder { color: #94a3b8; }
.form-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); background: #fff; }
.btn-primary {
    display: inline-flex !important; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 20px; border-radius: 6px;
    font-size: 13px; font-weight: 700; cursor: pointer;
    border: none; font-family: inherit;
    background: #2563eb; color: #fff;
    transition: background-color .15s ease;
    text-decoration: none; white-space: nowrap; width: auto;
}
.btn-primary:hover { background: #1d4ed8; }
