/**
 * Base Styles — Contract Box Realty
 * Reset, typography, utility classes, common components.
 */

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

html {
    font-size: var(--font-size-base);
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: var(--line-height);
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

p { margin-bottom: .75rem; color: var(--text-secondary); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); text-decoration: underline; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 1.5px solid transparent;
    font-family: var(--font-sans);
    font-size: .925rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
    padding: 13px 20px;
    font-size: 1rem;
    letter-spacing: .02em;
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
    width: 100%;
    margin-top: 10px;
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-accent {
    background: var(--accent);
    color: #fff;
}
.btn-accent:hover { background: var(--accent-dark); }

.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-icon { padding: 8px; border-radius: 50%; width: 36px; height: 36px; }

/* ── Spinner ────────────────────────────────────────────────────────────── */
.spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
    display: none;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: .9rem;
    margin-bottom: 20px;
    border-left: 4px solid;
}
.alert.show { display: block; animation: fadeIn var(--t-normal); }

.alert-success { background: var(--success-bg); color: var(--success-text); border-color: var(--success); }
.alert-error   { background: var(--error-bg);   color: var(--error-text);   border-color: var(--error);   }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border-color: var(--warning); }
.alert-info    { background: var(--info-bg);    color: var(--info-text);    border-color: var(--info);    }

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Utility ────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); font-size: .875rem; }
.d-none      { display: none !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
