/* =====================================================
   Customer Portal — UI Styles
   Mirrors Headspace.Web component styles
===================================================== */

/* ── Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { font-feature-settings: "kern" 1, "liga" 1; -webkit-font-smoothing: antialiased; }

/* ── Cards (box) ───────────────────────────────────── */
.box {
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 4px 0 rgba(29,78,216,0.06), 0 1px 2px -1px rgba(0,0,0,0.05);
    border: 1px solid rgba(226,232,240,0.9);
}
.box-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex; align-items: center; justify-content: space-between;
}
.box-body { padding: 1.25rem; }
.box-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #f1f5f9;
    background: rgba(248,250,252,0.7);
    border-radius: 0 0 0.75rem 0.75rem;
}

/* ── Buttons ───────────────────────────────────────── */
.ti-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.5rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 600;
    line-height: 1.25rem; transition: all 150ms ease; cursor: pointer;
    border: 1px solid transparent; text-decoration: none; white-space: nowrap;
}
.ti-btn:focus { outline: 2px solid #93c5fd; outline-offset: 2px; }
.ti-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.ti-btn-primary { background: #1d4ed8; color: #fff; }
.ti-btn-primary:hover { background: #2563eb; }

.ti-btn-light { background: #f1f5f9; color: #334155; }
.ti-btn-light:hover { background: #e2e8f0; }

.ti-btn-danger { background: #dc2626; color: #fff; }
.ti-btn-danger:hover { background: #b91c1c; }

.ti-btn-success { background: #059669; color: #fff; }
.ti-btn-success:hover { background: #047857; }

.ti-btn-outline-primary { background: transparent; border-color: #1d4ed8; color: #1d4ed8; }
.ti-btn-outline-primary:hover { background: #1d4ed8; color: #fff; }

.ti-btn-ghost { background: transparent; color: #475569; border-color: transparent; }
.ti-btn-ghost:hover { background: #f1f5f9; color: #0f172a; }

.ti-btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; border-radius: 0.375rem; }
.ti-btn-xs { padding: 0.25rem 0.5rem; font-size: 0.7rem; border-radius: 0.25rem; }
.ti-btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; border-radius: 0.75rem; }

/* ── Forms ─────────────────────────────────────────── */
.form-control {
    display: block; width: 100%; border-radius: 0.5rem; border: 1px solid #cbd5e1;
    padding: 0.625rem 0.75rem; font-size: 0.875rem; color: #1e293b; background: #fff;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.04); transition: border-color 150ms ease, box-shadow 150ms ease;
    font-family: inherit; line-height: 1.5;
}
.form-control::placeholder { color: #94a3b8; }
.form-control:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(191,219,254,0.5); outline: none; }
.form-control:disabled { background: #f8fafc; color: #94a3b8; cursor: not-allowed; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: #334155; margin-bottom: 0.375rem; }
.form-hint { font-size: 0.75rem; color: #64748b; margin-top: 0.25rem; }

/* ── Badges ────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 0.25rem; border-radius: 9999px;
    padding: 0.125rem 0.625rem; font-size: 0.75rem; font-weight: 600; line-height: 1rem;
}
.badge-primary  { background: #dbeafe; color: #1e40af; }
.badge-accent   { background: #fee2e2; color: #7f1d1d; }
.badge-success  { background: #d1fae5; color: #065f46; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-danger   { background: #fee2e2; color: #b91c1c; }
.badge-neutral  { background: #f1f5f9; color: #475569; }

/* ── Page header ───────────────────────────────────── */
.page-title    { font-size: 1.25rem; font-weight: 700; color: #0f172a; line-height: 1.75rem; }
.page-subtitle { font-size: 0.875rem; color: #64748b; margin-top: 0.125rem; }

/* ── Transitions ───────────────────────────────────── */
a, button { transition: box-shadow 200ms ease, transform 200ms ease, background-color 150ms ease, color 150ms ease, border-color 150ms ease, opacity 150ms ease; }

/* ── Scrollbars ────────────────────────────────────── */
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Sidebar active ────────────────────────────────── */
.sidebar-active {
    background: linear-gradient(90deg, rgba(29,78,216,0.35) 0%, rgba(29,78,216,0.12) 100%) !important;
    color: #93c5fd !important;
    border-left: 3px solid #3b82f6 !important;
    margin-left: -1px;
}
.sidebar-active i { color: #60a5fa !important; }

/* ── Section labels ────────────────────────────────── */
.section-label {
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: rgba(148,163,184,0.7); padding: 0.5rem 0.75rem 0.25rem;
}

/* ── Glow buttons ──────────────────────────────────── */
.btn-glow { box-shadow: 0 4px 14px 0 rgba(29,78,216,0.35); }
.btn-glow:hover { box-shadow: 0 6px 20px 0 rgba(29,78,216,0.5); transform: translateY(-1px); }

/* ── Auth cover panel ──────────────────────────────── */
.auth-cover-panel {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 40%, #2563eb 70%, #1e3a8a 100%);
    position: relative; overflow: hidden;
}
.auth-cover-panel::before {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.auth-cover-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.25; }
.auth-cover-orb-1 { width: 300px; height: 300px; top: -80px; right: -80px; background: #60a5fa; }
.auth-cover-orb-2 { width: 200px; height: 200px; bottom: 40px; left: -60px; background: #3b82f6; }
.auth-cover-orb-3 { width: 150px; height: 150px; top: 40%; right: 20%; background: #93c5fd; }

/* ── Loading spinner ───────────────────────────────── */
.bx-spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ── Dropdown menus ────────────────────────────────── */
.dropdown-menu {
    opacity: 0; transform: translateY(-8px) scale(0.97);
    transition: opacity 150ms ease, transform 150ms ease; pointer-events: none;
}
.dropdown-menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* ── Backdrop blur modal ───────────────────────────── */
.modal-backdrop { backdrop-filter: blur(4px); background: rgba(15,23,42,0.5); }

/* ── Toast notifications ───────────────────────────── */
.toast {
    position: fixed; top: 1.25rem; right: 1.25rem; z-index: 9999;
    min-width: 320px; max-width: 400px; padding: 0.875rem 1.125rem;
    border-radius: 0.625rem; box-shadow: 0 10px 30px -5px rgba(0,0,0,0.15);
    transform: translateX(calc(100% + 2rem));
    transition: transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex; align-items: center; gap: 0.75rem;
    backdrop-filter: blur(8px); border-left: 4px solid transparent;
}
.toast.show { transform: translateX(0); }
.toast-success { background: rgba(240,253,244,0.95); border-color: #16a34a; color: #14532d; }
.toast-error { background: rgba(254,242,242,0.95); border-color: #b91c1c; color: #7f1d1d; }
.toast-info { background: rgba(239,246,255,0.95); border-color: #1d4ed8; color: #1e3a8a; }

/* ── Form focus ────────────────────────────────────── */
input:focus, select:focus, textarea:focus { outline: none; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 640px) {
    .toast { min-width: calc(100vw - 2rem); right: 1rem; }
}
