/* ═══════════════════════════════════════════════════
   Windsor Plaza — Design System
   Premium, clean, iOS-inspired
   ═══════════════════════════════════════════════════ */

:root {
    /* Brand Colors — Windsor Plaza Gold */
    --brand-cyan: #0b8a96;
    --brand-cyan-dark: #0a5d65;
    --brand-sand: #d6b177;
    --brand-sand-dark: #9f7442;

    --gold: #d6b177;
    --gold-light: #e3c89d;
    --gold-dark: #9f7442;
    --gold-bg: #f8f2e8;
    --gold-bg2: #f1e4cd;

    /* Surfaces */
    --surface: #ffffff;
    --surface2: #f7f8f8;
    --surface3: #eef2f2;
    --bg: #f5f7f7;

    /* Text */
    --text: #1a1a1a;
    --text-secondary: #4f5b5e;
    --muted: #7d8a8d;
    --text-inverse: #ffffff;

    /* Borders */
    --border: #d8e2e4;
    --border-light: #e8eef0;

    /* Semantic */
    --accent: #0b8a96;
    --accent-hover: #0a6f79;
    --accent-subtle: rgba(11, 138, 150, 0.12);
    --danger: #d44a4a;
    --danger-bg: #fef2f2;
    --success: #2d9f6f;
    --success-bg: #f0faf5;
    --warning: #e6a817;
    --warning-bg: #fff9eb;
    --info: #4a8fd4;
    --info-bg: #f0f6fe;

    /* Spacing (8pt grid) */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    /* Shadows — two-layer, soft */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.1), 0 4px 16px rgba(0,0,0,0.06);

    /* Typography */
    --font: 'Manrope', 'Avenir Next', 'Segoe UI', 'Helvetica Neue', sans-serif;
    --font-display: 'Cormorant Garamond', 'Palatino Linotype', 'Times New Roman', serif;

    /* Transitions */
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --duration: 0.2s;
    --duration-slow: 0.4s;
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Typography Scale ── */
.text-display {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.text-title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.text-heading {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
}

.text-body {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
}

.text-caption {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--muted);
}

.text-micro {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

/* ── Card ── */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.card-body {
    padding: var(--sp-6);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-6);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    min-height: 44px;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface3);
    border-color: var(--gold-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--surface2);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: var(--sp-2) var(--sp-4);
    font-size: 13px;
    min-height: 36px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: var(--sp-4) var(--sp-8);
    font-size: 17px;
    min-height: 52px;
    border-radius: var(--radius-lg);
}

.btn-xl {
    padding: var(--sp-5) var(--sp-8);
    font-size: 18px;
    min-height: 56px;
    border-radius: var(--radius-lg);
    width: 100%;
}

.btn-disabled,
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Badge / Pill ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.badge-pending {
    background: var(--warning-bg);
    color: #92660d;
}

.badge-paid {
    background: var(--success-bg);
    color: #1a7a4c;
}

.badge-expired {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ── Input ── */
.input {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
    min-height: 44px;
}

.input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.input::placeholder {
    color: var(--muted);
}

/* ── Toast ── */
.toast-container {
    position: fixed;
    top: var(--sp-6);
    right: var(--sp-6);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    pointer-events: none;
}

.toast {
    padding: var(--sp-3) var(--sp-6);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-inverse);
    background: var(--text);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s var(--ease), toastOut 0.3s var(--ease) 2.7s forwards;
    pointer-events: auto;
    max-width: 360px;
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); }
}

/* ── Divider ── */
.divider {
    height: 1px;
    background: var(--border-light);
    border: none;
    margin: var(--sp-6) 0;
}

/* ── Utility ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* ── Focus Visible ── */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
