/* ============================================
   TradieKit.io — Shared Styles
   ============================================
   Single source of truth for brand colours,
   typography, nav, buttons, modals, and toasts.
   Include on every page BEFORE page-specific CSS.
   ============================================ */

/* === DESIGN TOKENS === */
:root {
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-ultra-light: #dbeafe;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --accent-light: #fef3c7;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-dark: #0f172a;
    --text: #1e293b;
    --text-light: #64748b;
    --text-white: #f1f5f9;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 12px;
    --radius-sm: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.07);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.14);
}

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

/* === TYPOGRAPHY === */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* === BRAND === */
.tk-brand {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.02em;
}
.tk-brand span { color: var(--accent); }

/* === AUTH MODAL === */
.tk-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.tk-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    position: relative;
}

.tk-modal-lg { max-width: 480px; }

.tk-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
}
.tk-modal-close:hover { color: var(--text); }

.tk-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.tk-modal-brand {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}
.tk-modal-brand span { color: var(--accent); }

.tk-modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0.5rem 0 0.3rem;
    color: var(--text);
}

.tk-modal-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Modal form elements */
.tk-form-group { margin-bottom: 0.8rem; }

.tk-form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    display: block;
    margin-bottom: 0.3rem;
}

.tk-form-input {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    transition: border-color 0.2s;
}
.tk-form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30,64,175,0.1);
}

.tk-form-error {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* === BUTTONS === */
.tk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.tk-btn-primary {
    background: var(--primary);
    color: white;
}
.tk-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.tk-btn-accent {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 14px rgba(245,158,11,0.3);
}
.tk-btn-accent:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

.tk-btn-full { width: 100%; }

.tk-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === UPGRADE PROMPT CARD === */
.tk-upgrade-card {
    background: linear-gradient(135deg, #eff6ff, #fef3c7);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.tk-upgrade-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.tk-upgrade-sub {
    font-size: 0.85rem;
    color: var(--text-light);
}

.tk-upgrade-note {
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 600;
    margin-top: 0.3rem;
}

/* === FEATURE LIST === */
.tk-feature-list {
    list-style: none;
    text-align: left;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.tk-feature-list li {
    font-size: 0.85rem;
    color: var(--text);
    line-height: 2;
}

.tk-feature-list li b {
    font-weight: 600;
}

/* === TOAST === */
.tk-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
    animation: tkToastIn 0.3s ease;
}

@keyframes tkToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === SUBSCRIPTION BADGES === */
.tk-sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}
.tk-sub-badge.free { background: #f1f5f9; color: var(--text-light); }
.tk-sub-badge.trial { background: #fef3c7; color: #92400e; }
.tk-sub-badge.active { background: #d1fae5; color: #065f46; }
.tk-sub-badge.pro { background: #10b981; color: white; font-size: 0.65rem; padding: 2px 6px; }

/* === TAGS === */
.tk-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.7rem;
    border-radius: 50px;
    letter-spacing: 0.02em;
}
.tk-tag-free { background: #d1fae5; color: #065f46; }
.tk-tag-pro { background: var(--primary-ultra-light); color: var(--primary); }

/* === UTILITY === */
.tk-text-center { text-align: center; }
.tk-text-muted { color: var(--text-light); }
.tk-text-small { font-size: 0.85rem; }
.tk-text-xs { font-size: 0.8rem; }
.tk-mt-1 { margin-top: 0.5rem; }
.tk-mt-2 { margin-top: 1rem; }
.tk-mb-1 { margin-bottom: 0.5rem; }
.tk-mb-2 { margin-bottom: 1rem; }

/* === ANIMATIONS === */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.fade-up { animation: fadeUp 0.6s ease-out both; }
.fade-up-d1 { animation-delay: 0.1s; }
.fade-up-d2 { animation-delay: 0.2s; }
.fade-up-d3 { animation-delay: 0.3s; }
.fade-up-d4 { animation-delay: 0.4s; }

/* === ACCESSIBILITY === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
.sr-only:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    padding: 1rem 1.5rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    z-index: 9999;
    border-radius: 0 0 8px 0;
}

/* Focus outlines for keyboard users */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* === RESPONSIVE HELPERS === */
@media (max-width: 768px) {
    .tk-hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
    .tk-hide-desktop { display: none !important; }
}
@media (max-width: 640px) {
    .tk-modal { padding: 1.2rem; max-width: 100%; }
    .tk-modal-lg { max-width: 100%; }
    .tk-modal-header { margin-bottom: 1rem; }
    .tk-modal-title { font-size: 1.05rem; }
    .tk-btn { padding: 0.65rem 1rem; font-size: 0.9rem; }
    .tk-btn-full { width: 100%; }
}
