/* Design tokens live in tokens.css (single source of truth, invariant 8).
   Load them first, then consume the variables below. */
@import url("tokens.css");

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Loading screen overlay */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 1000;
    transition: opacity 0.4s ease;
}
.loading-screen.hidden { opacity: 0; pointer-events: none; }
.loader-logo { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.loader-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-quote {
    font-style: italic; color: rgba(255, 255, 255, 0.9);
    max-width: 360px; text-align: center; padding: 0 1rem;
}

/* Weather widget */
.weather-widget {
    position: fixed; top: 1rem; right: 1rem;
    background: var(--card); padding: 0.5rem 1rem;
    border-radius: 999px; box-shadow: var(--shadow);
    font-size: 0.875rem; color: var(--muted);
}

/* Login card */
.login-card {
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 0.5rem; color: var(--primary); }
.brand h1 { font-size: 1.5rem; font-weight: 700; }
.brand-icon { flex-shrink: 0; }
.subtitle { color: var(--muted); margin: 0.5rem 0 1.5rem; font-size: 0.95rem; }

.field { margin-bottom: 1.25rem; }
.field label {
    display: block; margin-bottom: 0.4rem;
    font-size: 0.875rem; font-weight: 500;
}
.field input {
    width: 100%; padding: 0.7rem 0.9rem;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 0.95rem; transition: border-color 0.15s;
}
.field input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-focus-ring);
}

.form-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem; font-size: 0.85rem;
}
.remember { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); }
.forgot { color: var(--primary); text-decoration: none; }

.primary-btn {
    width: 100%; padding: 0.8rem;
    background: var(--primary); color: white;
    border: none; border-radius: 8px;
    font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: background 0.15s;
}
.primary-btn:hover { background: var(--primary-hover); }
.primary-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.error-message {
    margin-top: 1rem; padding: 0.7rem 0.9rem;
    background: var(--error-bg); color: var(--error);
    border: 1px solid var(--error-border); border-radius: 8px;
    font-size: 0.875rem;
}

.success-message {
    margin-top: 1rem; padding: 0.7rem 0.9rem;
    background: var(--success-bg); color: var(--success);
    border: 1px solid var(--success-border); border-radius: 8px;
    font-size: 0.875rem;
}

.signup-prompt {
    text-align: center; margin-top: 1.5rem;
    font-size: 0.875rem; color: var(--muted);
}
.signup-prompt a { color: var(--primary); text-decoration: none; }

/* Footer */
.page-footer {
    margin-top: 2rem; display: flex; gap: 1rem;
    font-size: 0.8rem; color: var(--muted);
}
.page-footer a { color: var(--muted); text-decoration: none; }

/* Content pages (privacy, terms, support) */
.content-page {
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 2.5rem 3rem;
    width: 100%;
    max-width: 760px;
    border: 1px solid var(--border);
}
.content-page .content-header {
    display: flex; align-items: center; gap: 0.5rem;
    color: var(--primary); margin-bottom: 0.25rem;
}
.content-page .content-header h1 { font-size: 1.5rem; font-weight: 700; }
.content-page .updated { color: var(--muted); font-size: 0.8rem; margin-bottom: 1.75rem; }
.content-body h2 {
    font-size: 1.1rem; font-weight: 600; margin: 1.75rem 0 0.6rem;
    color: var(--text);
}
.content-body p { font-size: 0.92rem; line-height: 1.6; margin-bottom: 0.85rem; color: var(--text); }
.content-body ul { margin: 0.4rem 0 1rem 1.25rem; }
.content-body li { font-size: 0.92rem; line-height: 1.6; margin-bottom: 0.4rem; }
.content-body a { color: var(--primary); text-decoration: none; }
.content-body a:hover { text-decoration: underline; }
.content-back {
    text-align: center; margin-top: 2rem;
    font-size: 0.875rem; color: var(--muted);
}
.content-back a { color: var(--primary); text-decoration: none; }
.faq-item { margin-bottom: 1.1rem; }
.faq-item h2 { margin-bottom: 0.4rem; }
.support-card {
    margin-top: 0.5rem; padding: 1rem 1.2rem;
    background: var(--panel-subtle); border: 1px solid var(--border); border-radius: 8px;
}
.support-card p:last-child { margin-bottom: 0; }
