/* ─────────────────────────────────────────────────────────────
   Evolved Sense Identity — UI Styles
   Auth pages, admin pages, account settings, header & footer.
   ───────────────────────────────────────────────────────────── */

:root {
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --primary-light: rgba(99, 102, 241, 0.08);
    --text: #1E293B;
    --text-muted: #64748B;
    --bg: #F8FAFC;
    --card-bg: #FFFFFF;
    --border: #E2E8F0;
    --error: #EF4444;
    --error-bg: #FEF2F2;
    --success: #10B981;
    --success-bg: #F0FDF4;
    --info-bg: #EFF6FF;
    --info-border: #BFDBFE;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

/* ── Site Header ─────────────────────────────────────────────── */

.site-header {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo img {
    height: 32px;
    width: auto;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.header-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.header-link:hover {
    color: var(--text);
    background: var(--primary-light);
    text-decoration: none;
}

.header-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.header-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ── Page Content ────────────────────────────────────────────── */

.page-content {
    flex: 1;
    padding: 2rem 1rem;
}

/* ── Page Container (centered content for admin/settings pages) */

.page-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.page-container.narrow {
    max-width: 560px;
}

/* ── Page Card ───────────────────────────────────────────────── */

.page-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.page-card-header {
    margin-bottom: 1.5rem;
}

.page-card-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.page-card-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ── Site Footer ─────────────────────────────────────────────── */

.site-footer {
    background: var(--text);
    color: #CBD5E1;
    padding: 2rem 1.5rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo {
    height: 24px;
    width: auto;
    filter: brightness(0) invert(1) opacity(0.7);
}

.footer-brand span {
    font-weight: 600;
    color: #fff;
    font-size: 0.9375rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #94A3B8;
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-copy {
    font-size: 0.75rem;
    color: #64748B;
}

/* ── Auth Container (Login, Register, etc.) ──────────────────── */

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #EEF2FF 0%, #F8FAFC 50%, #FDF4FF 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

/* ── Auth Header ─────────────────────────────────────────────── */

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    height: 40px;
    width: auto;
    margin-bottom: 1.25rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Google OAuth Button ─────────────────────────────────────── */

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-google:hover {
    border-color: #CBD5E1;
    background: #F8FAFC;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* ── Divider ─────────────────────────────────────────────────── */

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Form Elements ───────────────────────────────────────────── */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
    color: #94A3B8;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ── Checkbox ────────────────────────────────────────────────── */

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-check-input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font);
    color: #FFFFFF;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font);
    color: var(--primary);
    background: transparent;
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-outline:hover {
    background: var(--primary-light);
    text-decoration: none;
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font);
    color: #FFFFFF;
    background: var(--error);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font);
    color: #FFFFFF;
    background: var(--success);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-success:hover {
    background: #059669;
}

/* ── Links ───────────────────────────────────────────────────── */

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.forgot-link {
    font-size: 0.8125rem;
    font-weight: 400;
}

.auth-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ── Data Table ──────────────────────────────────────────────── */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead tr {
    border-bottom: 2px solid var(--border);
    text-align: left;
}

.data-table th,
.data-table td {
    padding: 0.75rem 0.5rem;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.1s ease;
}

.data-table tbody tr:hover {
    background: var(--primary-light);
}

/* ── Status Badge ────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
}

.badge-success { background: var(--success-bg); color: #065F46; }
.badge-danger  { background: var(--error-bg); color: #991B1B; }
.badge-warning { background: #FFFBEB; color: #92400E; }
.badge-muted   { background: #F1F5F9; color: #64748B; }
.badge-primary { background: var(--primary-light); color: var(--primary); }

/* ── Info Box ────────────────────────────────────────────────── */

.info-box {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.8;
}

.info-box p {
    margin: 0;
}

.info-box strong {
    color: var(--text);
}

/* ── Alerts ──────────────────────────────────────────────────── */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.alert ul {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
}

.alert ul li {
    margin-bottom: 0.25rem;
}

.alert-danger {
    background: var(--error-bg);
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-success {
    background: var(--success-bg);
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-info {
    background: var(--info-bg);
    color: #1E40AF;
    border: 1px solid var(--info-border);
}

/* Hide empty validation summary */
.alert-danger:empty,
.alert-danger:not(:has(*)):not(:empty) {
    display: none;
}

/* ── Field Errors ────────────────────────────────────────────── */

.field-error {
    display: block;
    font-size: 0.8125rem;
    color: var(--error);
    margin-top: 0.25rem;
    min-height: 0;
}

.field-error:empty {
    display: none;
}

.input-validation-error {
    border-color: var(--error) !important;
}

.input-validation-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* ── Turnstile Widget ────────────────────────────────────────── */

.cf-turnstile {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 768px) {
    .header-inner {
        padding: 0 1rem;
        gap: 1rem;
    }

    .header-nav {
        display: none;
    }

    .header-actions .header-link span {
        display: none;
    }

    .page-content {
        padding: 1.5rem 0.75rem;
    }

    .page-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.75rem 1.25rem;
        box-shadow: var(--shadow);
    }

    .auth-title {
        font-size: 1.25rem;
    }

    .page-card {
        padding: 1.25rem;
    }

    .page-card-header h1 {
        font-size: 1.25rem;
    }

    .data-table {
        font-size: 0.8rem;
    }
}
