/* ═══════════════════════════════════════════════════════════════════════
   Mukuru Portal — V2 Mobile-First Styles
   Base = mobile, scale up with min-width breakpoints
   ═══════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables (environment-aware theming) ─────────────────────── */
:root {
    --accent:        #16a34a;
    --accent-dark:   #14532d;
    --accent-light:  #22c55e;
    --accent-hover:  #15803d;
    --accent-bg:     #f0fdf4;
}

[data-env="uat"] {
    --accent:        #FF6B35;
    --accent-dark:   #c2410c;
    --accent-light:  #fb923c;
    --accent-hover:  #ea580c;
    --accent-bg:     #fff7ed;
}

/* ── Accent utility classes ────────────────────────────────────────── */
.bg-accent       { background-color: var(--accent); }
.bg-accent-bg    { background-color: var(--accent-bg); }
.text-accent     { color: var(--accent); }
.text-accent-dark{ color: var(--accent-dark); }
.border-accent   { border-color: var(--accent); }

/* ── Buttons (mobile-first: full-width, stackable) ─────────────────── */
.btn-primary, .btn-secondary, .btn-danger, .btn-info, .btn-warning {
    display: inline-block;
    padding: 0.625rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background-color 0.15s;
    cursor: pointer;
    border: none;
    text-align: center;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary   { background-color: var(--accent); color: white; }
.btn-primary:hover { background-color: var(--accent-hover); }

.btn-secondary { background-color: #e5e7eb; color: #374151; }
.btn-secondary:hover { background-color: #d1d5db; }

.btn-danger    { background-color: #ef4444; color: white; }
.btn-danger:hover { background-color: #dc2626; }

.btn-info      { background-color: #2563eb; color: white; }
.btn-info:hover { background-color: #1d4ed8; }

.btn-warning   { background-color: #d97706; color: white; }
.btn-warning:hover { background-color: #b45309; }

/* ── Info / result boxes ───────────────────────────────────────────── */
.info-box {
    background-color: var(--accent-bg);
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.result-box {
    background-color: var(--accent-bg);
    border: 1px solid var(--accent-light);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}
.result-box .result-label { color: var(--accent-dark); font-weight: 600; }
.result-box .result-value { color: #374151; }

/* ── Sidebar ───────────────────────────────────────────────────────── */
.sidebar { scrollbar-width: thin; }
.nav-link { border-left: 3px solid transparent; }
.nav-active { color: var(--accent); background-color: var(--accent-bg); border-left-color: var(--accent); }
.nav-link:hover:not(.nav-active) { border-left-color: #e5e7eb; }
.env-badge { letter-spacing: 0.05em; }

/* ── Form Styles ───────────────────────────────────────────────────── */
.form-input, .form-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-size: 1rem; /* 16px prevents iOS zoom on focus */
    -webkit-appearance: none;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.form-select { background-color: white; }

/* ── Alerts ────────────────────────────────────────────────────────── */
.alert-error   { background:#fee2e2; color:#991b1b; padding:0.75rem 1rem; border-radius:0.375rem; margin-bottom:1rem; border-left:4px solid #ef4444; font-size:0.875rem; }
.alert-success { background:#d1fae5; color:#065f46; padding:0.75rem 1rem; border-radius:0.375rem; margin-bottom:1rem; border-left:4px solid #10b981; font-size:0.875rem; }
.alert-warning { background:#fef3c7; color:#92400e; padding:0.75rem 1rem; border-radius:0.375rem; margin-bottom:1rem; border-left:4px solid #f59e0b; font-size:0.875rem; }
.alert-info    { background:#dbeafe; color:#1e40af; padding:0.75rem 1rem; border-radius:0.375rem; margin-bottom:1rem; border-left:4px solid #3b82f6; font-size:0.875rem; }

/* ── Card ──────────────────────────────────────────────────────────── */
.card {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ── Loader ────────────────────────────────────────────────────────── */
#loader.active { display: flex !important; }
.border-t-accent { border-top-color: var(--accent); }

/* ── Balance info cards (toolbox-style) ────────────────────────────── */
.balance-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.balance-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.875rem;
}

.balance-card .bal-label {
    font-size: 0.625rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
}

.balance-card .bal-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
}

.balance-card .bal-unit {
    font-size: 0.875rem;
    font-weight: 400;
    color: #9ca3af;
}

.balance-card .bal-breakdown {
    border-top: 1px solid #e5e7eb;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.balance-card .bal-breakdown .flex { display: flex; justify-content: space-between; gap: 0.5rem; }
.balance-card .bal-breakdown .flex span:last-child { text-align: right; white-space: nowrap; }

.balance-card .bal-section-label {
    border-top: 1px solid #e5e7eb;
    margin-top: 0.625rem;
    padding-top: 0.5rem;
    font-size: 0.625rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
    font-weight: 600;
}

/* ── Step indicator bar ────────────────────────────────────────────── */
.step-bar { padding: 0 0.25rem; }
.step-item { min-width: 0; }

.step-dot-inline {
    width: 1.5rem; height: 1.5rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; font-weight: 700;
    transition: all 0.2s;
}
.step-dot-inline.active   { background-color: var(--accent); color: white; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.step-dot-inline.completed{ background-color: var(--accent); color: white; }
.step-dot-inline.pending  { background-color: #e5e7eb; color: #9ca3af; }

.step-connector { height: 2px; flex: 1; min-width: 0.5rem; margin-top: -0.75rem; border-radius: 1px; }
.bg-accent-line { background-color: var(--accent); }

/* ── Mobile base (default) ─────────────────────────────────────────── */
.sidebar.open { transform: translateX(0); }

/* Button groups stack on mobile */
.btn-group-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Hide step labels on small screens, just show dots */
.step-item .step-label { display: none; }

/* ── Tablet (≥640px) ───────────────────────────────────────────────── */
@media (min-width: 640px) {
    .balance-grid { grid-template-columns: 1fr; }
    .balance-card-full { grid-column: 1 / -1; }

    .btn-group-mobile { flex-direction: row; }

    .step-dot-inline { width: 1.75rem; height: 1.75rem; font-size: 0.7rem; }
    .step-item .step-label { display: block; }
}

/* ── Desktop (≥768px) ──────────────────────────────────────────────── */
@media (min-width: 768px) {
    .card { padding: 1.5rem; }
}
