/* ==========================================================
   ChoffySMS — Design tokens
   ========================================================== */
:root {
    --primary: #6C63FF;
    --primary-light: #7F77DD;
    --primary-dark: #564FCC;
    --bg: #F7F7FC;
    --surface: #FFFFFF;
    --border: #E6E4F5;
    --text: #1E1B2E;
    --text-muted: #6B6880;
    --success: #1FA971;
    --success-bg: #E8F8F1;
    --danger: #E5484D;
    --danger-bg: #FDECEC;
    --warning: #C77A1F;
    --warning-bg: #FCF3E3;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 4px 18px rgba(108, 99, 255, 0.08);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 0.4em; line-height: 1.2; }
p { margin: 0 0 1em; color: var(--text-muted); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14.5px;
    border: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--primary-light), var(--primary-dark)); color: #fff; }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(108,99,255,0.35); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease;
}
input:focus, select:focus { border-color: var(--primary); }
.field-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }

/* ---------------- Alerts ---------------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }

/* ---------------- Auth pages ---------------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 40px 36px;
}
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-logo .mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 16px;
}
.auth-logo span { font-weight: 700; font-size: 18px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 14px; color: var(--text-muted); }
.auth-foot a { color: var(--primary); font-weight: 600; }

/* ---------------- Public nav / landing ---------------- */
.site-header {
    position: sticky; top: 0; z-index: 30;
    background: rgba(247,247,252,0.9); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { font-weight: 600; font-size: 14.5px; color: var(--text-muted); }
.nav-links a:hover { color: var(--primary); }
.nav-actions { display: flex; gap: 12px; align-items: center; }

.hero { padding: 90px 0 70px; text-align: center; }
.hero h1 { font-size: 44px; max-width: 720px; margin: 0 auto 18px; letter-spacing: -0.02em; }
.hero p.lead { max-width: 560px; margin: 0 auto 32px; font-size: 17px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; }

.badge { display: inline-block; padding: 6px 14px; border-radius: 999px; background: #EFEDFC; color: var(--primary-dark); font-size: 13px; font-weight: 700; margin-bottom: 20px; }

.section { padding: 60px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.feature-card .icon { width: 44px; height: 44px; border-radius: 12px; background: #EFEDFC; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; font-size: 20px; }

/* ---------------- Dashboard shell ---------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px; flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 26px; }
.sidebar .brand .mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--primary-light), var(--primary-dark)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.sidebar .brand span { font-weight: 700; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; border-radius: 10px;
    font-weight: 600; font-size: 14.5px; color: var(--text-muted);
    margin-bottom: 3px;
}
.sidebar nav a:hover { background: var(--bg); color: var(--text); }
.sidebar nav a.active { background: #EFEDFC; color: var(--primary-dark); }
.sidebar .logout { margin-top: auto; }
.sidebar-bottom { position: absolute; bottom: 24px; width: calc(100% - 32px); }

.main { flex: 1; min-width: 0; }
.topbar {
    height: 72px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.topbar .wallet-chip {
    display: flex; align-items: center; gap: 8px;
    background: #EFEDFC; color: var(--primary-dark); font-weight: 700;
    padding: 9px 16px; border-radius: 999px; font-size: 14px;
}
.content { padding: 28px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.stat-card .label { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.stat-card .value { font-size: 26px; font-weight: 800; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; font-size: 14px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }

.status-pill { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.status-success, .status-received { background: var(--success-bg); color: var(--success); }
.status-pending, .status-waiting { background: var(--warning-bg); color: var(--warning); }
.status-failed, .status-expired, .status-cancelled { background: var(--danger-bg); color: var(--danger); }

.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.service-tile {
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 18px 14px; text-align: center; cursor: pointer; background: var(--surface);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.service-tile:hover { border-color: var(--primary); }
.service-tile.selected { border-color: var(--primary); background: #F4F3FE; }
.service-tile .name { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.service-tile .price { font-size: 13px; color: var(--text-muted); }

.otp-box {
    display: flex; align-items: center; justify-content: space-between;
    background: #F4F3FE; border: 1.5px dashed var(--primary); border-radius: var(--radius-sm);
    padding: 18px 20px; margin-top: 14px;
}
.otp-box .code { font-size: 26px; font-weight: 800; letter-spacing: 4px; color: var(--primary-dark); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }

footer.site-footer { border-top: 1px solid var(--border); padding: 30px 0; text-align: center; color: var(--text-muted); font-size: 13.5px; }

/* ---------------- Mobile ---------------- */
@media (max-width: 860px) {
    .grid-3, .stat-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 30px; }
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; border-right: none; border-bottom: 1px solid var(--border); }
    .sidebar nav { display: flex; overflow-x: auto; gap: 4px; }
    .sidebar nav a { white-space: nowrap; }
    .sidebar-bottom { display: none; }
    .content { padding: 18px; }
    .nav-links { display: none; }
}
