:root {
    --bg: #0a0a0a;
    --bg-card: #141414;
    --bg-hover: #1a1a1a;
    --border: #2a2a2a;
    --text-muted: #9a9a9a;
}

/* Map the palette onto Bootstrap's dark theme variables */
[data-bs-theme="dark"] {
    --bs-body-bg: var(--bg);
    --bs-body-color: #f5f5f5;
    --bs-secondary-color: var(--text-muted);
    --bs-border-color: var(--border);
    --bs-card-bg: var(--bg-card);
    --bs-tertiary-bg: var(--bg-hover);
    --bs-border-radius: .625rem;
    --bs-border-radius-lg: .875rem;
}

body {
    background-color: var(--bg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Navbar & footer */
.app-navbar {
    background-color: rgba(10, 10, 10, .92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(6px);
}
.app-footer {
    border-top: 1px solid var(--border);
    background-color: var(--bg);
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.card-hover:hover {
    background-color: var(--bg-hover);
    border-color: #3a3a3a;
    transform: translateY(-2px);
}

/* Forms */
.form-control,
.input-group-text {
    background-color: var(--bg);
    border-color: var(--border);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.form-control:focus {
    background-color: var(--bg);
    border-color: #6c6c6c;
    box-shadow: 0 0 0 .2rem rgba(255, 255, 255, .08);
}
.form-control::placeholder { color: #666; }

/* Buttons */
.btn { transition: all .2s ease; }
.btn-outline-light { border-color: var(--border); }
.btn-outline-light:hover { background-color: var(--bg-hover); border-color: #4a4a4a; color: #fff; }

/* Toast notifications */
.app-toast-container {
    top: 56px; /* sits just below the sticky navbar */
    z-index: 1090;
    max-width: 100%;
}
.app-toast {
    --toast-accent: #9a9a9a;
    --toast-delay: 5000ms;
    position: relative;
    overflow: hidden;
    width: 340px;
    max-width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: .75rem;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .5);
    transition: opacity .2s ease, transform .2s ease;
}
.app-toast.show { animation: toast-in .3s cubic-bezier(.2, .8, .2, 1); }
.app-toast.showing { transform: translateX(12px); }
.app-toast:hover { background-color: var(--bg-hover); }
.app-toast-success { --toast-accent: var(--bs-success); }
.app-toast-error   { --toast-accent: var(--bs-danger); }
.app-toast-warning { --toast-accent: var(--bs-warning); }
.app-toast-info    { --toast-accent: var(--bs-info); }
.app-toast-icon { color: var(--toast-accent); font-size: 1.05rem; line-height: 1.4; }
.app-toast .toast-body { font-size: .9rem; line-height: 1.4; }
.app-toast-progress {
    height: 2px;
    background-color: var(--toast-accent);
    transform-origin: left;
    animation: toast-progress var(--toast-delay) linear forwards;
}
.app-toast:hover .app-toast-progress { animation-play-state: paused; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-progress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) {
    .app-toast, .app-toast.show { animation: none; transition: opacity .2s ease; }
    .app-toast-progress { animation: none; display: none; }
}

/* Layout helpers */
.auth-card { max-width: 480px; }
.hero-icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background-color: var(--bg-card);
    font-size: 1.75rem;
}
.info-label {
    font-size: .75rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Thai caption under English text */
.th {
    display: block;
    font-size: .74em;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
    opacity: .6;
}
.btn .th { opacity: .7; }
.form-label .th, .info-label .th { display: inline; margin-left: .35em; font-size: .95em; }
.nav-link .th { font-size: .68em; }
.nav-pills .nav-link { color: var(--bs-body-color); border: 1px solid var(--border); }
.nav-pills .nav-link.active { background-color: #f5f5f5; color: #0a0a0a; border-color: #f5f5f5; }

/* Top-up guide image (landscape 16:9) */
.topup-guide {
    border: 1px solid var(--border);
    border-radius: .875rem;
    overflow: hidden;
    background-color: var(--bg);
}
.topup-guide img { width: 100%; height: 100%; object-fit: cover; }
.topup-guide-empty { border: 1px dashed #3a3a3a; border-radius: .875rem; }
.topup-steps li + li { margin-top: .5rem; }

/* ---- Admin back office ---- */
.admin-switch { width: 2.75em; height: 1.5em; cursor: pointer; }
.slip-thumb { max-height: 320px; object-fit: contain; background: #000; }
.plan-table input.form-check-input { width: 1.2em; height: 1.2em; }
.plan-table td, .plan-table th { white-space: nowrap; }
.plan-table td:first-child { min-width: 180px; }
