/* =========================================================
   BASE STYLES — Reset, variables, typography, layout
   ========================================================= */

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

/* === CSS Variables (editable: change these to theme the app) === */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2234;
    --bg-input: #0f1729;
    --border: #2a3650;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --star-color: #fffbe6;
    /* Safe area insets for app wrapping (Capacitor/Cordova) */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

/* === Base typography === */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* === Header === */
header {
    text-align: center;
    padding: 2rem 1rem 1rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #0f1525 0%, var(--bg-primary) 100%);
    padding-top: calc(2rem + var(--safe-top));
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #818cf8, #6366f1, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* === Layout === */
main {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* === Dividers === */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.85rem 0;
}

/* === Readonly inputs === */
input[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
}

/* === Footer === */
footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    padding-bottom: calc(1.5rem + var(--safe-bottom));
}
