/*
 * TrimCI Component Styles
 * Based on Pencil design system (Lunaris)
 */

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-secondary);
    background: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
}

.sidebar__header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 8px;
    height: 88px;
}

.sidebar__logo {
    font-family: var(--font-primary);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    line-height: 1;
}

.sidebar__logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.sidebar__content {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
}

.sidebar__section-title {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    color: var(--sidebar-foreground);
    padding: 16px;
    line-height: 1.15;
}

.sidebar__item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-pill);
    font-family: var(--font-secondary);
    font-size: var(--text-lg);
    color: var(--sidebar-foreground);
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
    line-height: 1.5;
}

.sidebar__item:hover {
    background: var(--sidebar-accent);
    color: var(--sidebar-accent-foreground);
}

.sidebar__item--active {
    background: var(--sidebar-accent);
    color: var(--sidebar-accent-foreground);
}

.sidebar__item-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.sidebar__badge {
    margin-left: auto;
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}

.sidebar__footer {
    padding: 24px 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar__user {
    flex: 1;
    min-width: 0;
}

.sidebar__user-name {
    font-size: var(--text-lg);
    color: var(--sidebar-accent-foreground);
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__user-email {
    font-size: var(--text-sm);
    color: var(--sidebar-foreground);
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__logout-form {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sidebar__logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    color: var(--sidebar-foreground);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.sidebar__logout-btn:hover {
    background: var(--sidebar-accent);
    color: var(--sidebar-accent-foreground);
    border-color: var(--sidebar-border);
}

.sidebar__logout-btn .material-symbols-sharp {
    font-size: 20px;
}

/* ── Main Layout ── */
.layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Breadcrumbs ── */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0;
}

.breadcrumbs__item {
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    color: var(--muted-foreground);
    text-decoration: none;
}

.breadcrumbs__item:hover {
    color: var(--foreground);
}

.breadcrumbs__item--active {
    color: var(--foreground);
}

.breadcrumbs__separator {
    width: 14px;
    height: 14px;
    color: var(--muted-foreground);
    margin: 0 4px;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-family: var(--font-primary);
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--foreground);
}

.page-subtitle {
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    color: var(--muted-foreground);
    margin-top: 8px;
}

/* ── Cards ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.card--error-border {
    border: 2px solid var(--color-error-foreground);
}

.card__header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.card__title {
    font-family: var(--font-primary);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--foreground);
}

.card__content {
    padding: 24px;
}

.card__actions {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Stat Cards ── */
.stats-row {
    display: flex;
    gap: 16px;
}

.stat-card {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.stat-card__label {
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    color: var(--muted-foreground);
}

.stat-card__value {
    font-family: var(--font-primary);
    font-size: var(--text-5xl);
    font-weight: 700;
    color: var(--foreground);
}

.stat-card__change {
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
}

.stat-card__change--negative {
    color: var(--color-error-foreground);
}

.stat-card__change--positive {
    color: var(--color-success-foreground);
}

/* ── Info Row ── */
.info-row {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.info-cell {
    flex: 1;
    padding: 20px;
    background: var(--card);
}

.info-cell + .info-cell {
    border-left: 1px solid var(--border);
}

.info-cell__label {
    font-size: var(--text-sm);
    color: var(--muted-foreground);
}

.info-cell__value {
    font-family: var(--font-primary);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--foreground);
    margin-top: 4px;
}

/* ── Alerts / Banners ── */
.alert {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-none);
}

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

.alert__icon { width: 24px; height: 24px; flex-shrink: 0; }

.alert--info .alert__title,
.alert--info .alert__description,
.alert--info .alert__icon { color: var(--color-info-foreground); }

.alert--success .alert__title,
.alert--success .alert__description,
.alert--success .alert__icon { color: var(--color-success-foreground); }

.alert--warning .alert__title,
.alert--warning .alert__description,
.alert--warning .alert__icon { color: var(--color-warning-foreground); }

.alert--error .alert__title,
.alert--error .alert__description,
.alert--error .alert__icon { color: var(--color-error-foreground); }

.alert__title {
    font-family: var(--font-secondary);
    font-size: var(--text-lg);
    font-weight: 500;
    line-height: 1.5;
}

.alert__description {
    font-family: var(--font-secondary);
    font-size: var(--text-lg);
    line-height: 1.5;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: 500;
    line-height: 1.43;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: opacity var(--transition-fast), background var(--transition-fast);
    white-space: nowrap;
}

.btn:hover { opacity: 0.9; }

.btn--primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn--secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.btn--outline {
    background: var(--background);
    color: var(--foreground);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn--ghost {
    background: transparent;
    color: var(--foreground);
}

.btn--destructive {
    background: var(--destructive);
    color: #fff;
}

.btn--lg {
    padding: 12px 24px;
    height: 48px;
}

.btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
}

/* ── Labels / Badges ── */
.label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-primary);
    font-size: var(--text-base);
    padding: 8px;
    border-radius: var(--radius-pill);
    line-height: 1.15;
}

.label--success    { background: var(--color-success);  color: var(--color-success-foreground); }
.label--warning    { background: var(--color-warning);  color: var(--color-warning-foreground); }
.label--error      { background: var(--color-error);    color: var(--color-error-foreground); }
.label--info       { background: var(--color-info);     color: var(--color-info-foreground); }
.label--secondary  { background: var(--secondary);      color: var(--secondary-foreground); }

/* ── Select / Form Controls ── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--foreground);
}

.form-select,
.form-input {
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    height: 40px;
    padding: 8px 16px;
    background: var(--background);
    color: var(--foreground);
    border: 1px solid var(--input);
    border-radius: var(--radius-pill);
    outline: none;
    transition: border-color var(--transition-fast);
    width: 100%;
}

.form-select:focus,
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.15);
}

.form-input::placeholder {
    color: var(--muted-foreground);
}

/* ── Tables ── */
.table-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table-card__header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.table-card__title {
    font-family: var(--font-primary);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--foreground);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--muted-foreground);
    text-align: left;
    padding: 10px 24px;
    border-bottom: 1px solid var(--border);
}

.table td {
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    color: var(--foreground);
    padding: 10px 24px;
    border-bottom: 1px solid var(--border);
}

.table tr:last-child td {
    border-bottom: none;
}

/* ── Status Cards (Integration Health) ── */
.status-cards {
    display: flex;
    gap: 16px;
}

.status-card {
    flex: 1;
    padding: 24px;
    border-radius: var(--radius-md);
    text-align: center;
}

.status-card--ok      { background: var(--color-success); }
.status-card--warning  { background: var(--color-warning); }
.status-card--error    { background: var(--color-error); }

.status-card__count {
    font-family: var(--font-primary);
    font-size: var(--text-5xl);
    font-weight: 700;
}

.status-card__label {
    font-size: var(--text-lg);
    font-weight: 500;
}

.status-card--ok .status-card__count,
.status-card--ok .status-card__label      { color: var(--color-success-foreground); }
.status-card--warning .status-card__count,
.status-card--warning .status-card__label  { color: var(--color-warning-foreground); }
.status-card--error .status-card__count,
.status-card--error .status-card__label    { color: var(--color-error-foreground); }

/* ── Provider Cards ── */
.provider-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.provider-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.provider-card__icon {
    width: 40px;
    height: 40px;
}

.provider-card__name {
    font-family: var(--font-primary);
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--foreground);
}

.provider-card__description {
    font-size: var(--text-sm);
    color: var(--muted-foreground);
    line-height: 1.5;
}

/* ── Connection Card ── */
.connection-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--color-success-foreground);
}

/* ── Recommendation Card ── */
.reco-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reco-card__metrics {
    display: flex;
}

.reco-card__metric {
    flex: 1;
    padding: 12px 16px;
}

.reco-card__metric + .reco-card__metric {
    border-left: 1px solid var(--border);
}

.reco-card__metric-label {
    font-family: var(--font-primary);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.reco-card__metric-value {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: 600;
    margin-top: 4px;
}

/* ── Utilities ── */
.text-primary     { color: var(--primary); }
.text-muted       { color: var(--muted-foreground); }
.text-error       { color: var(--color-error-foreground); }
.text-success     { color: var(--color-success-foreground); }
.text-warning     { color: var(--color-warning-foreground); }

.flex             { display: flex; }
.flex-col         { flex-direction: column; }
.items-center     { align-items: center; }
.justify-between  { justify-content: space-between; }
.gap-2            { gap: var(--space-2); }
.gap-3            { gap: var(--space-3); }
.gap-4            { gap: var(--space-4); }
.gap-6            { gap: var(--space-6); }
.w-full           { width: 100%; }

/* ══════════════════════════════════════════════════════════════════════
   Public Pages (landing, auth, gate)
   Shared visual language for unauthenticated screens.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Topbar ── */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    z-index: 40;
}

.topbar__inner {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.topbar__brand-mark {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: var(--primary-foreground);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topbar__brand-mark .material-symbols-sharp {
    font-size: 20px;
}

.topbar__brand-text {
    font-family: var(--font-primary);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.topbar__nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    list-style: none;
}

.topbar__nav-link {
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--muted-foreground);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.topbar__nav-link:hover {
    color: var(--foreground);
}

/* ── Public Shell Wrapper ── */
.public-shell {
    padding-top: 72px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Hero ── */
.hero {
    padding: 96px 32px 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: var(--muted);
    color: var(--primary);
    font-family: var(--font-primary);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--space-6);
}

.hero__title {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--foreground);
    max-width: 820px;
    margin: 0;
    letter-spacing: -0.02em;
}

.hero__subtitle {
    font-family: var(--font-secondary);
    font-size: var(--text-xl);
    color: var(--muted-foreground);
    max-width: 560px;
    margin: var(--space-6) 0 var(--space-8);
    line-height: 1.6;
}

.hero__actions {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    justify-content: center;
}

.hero__signin {
    margin-top: var(--space-5);
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    color: var(--muted-foreground);
}

.hero__signin-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.hero__signin-link:hover {
    opacity: 0.85;
}

/* ── Features ── */
.features {
    padding: 64px 32px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.section-header__label {
    font-family: var(--font-primary);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-2);
}

.section-header__title {
    font-family: var(--font-primary);
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 700;
    color: var(--foreground);
    letter-spacing: -0.01em;
}

.features__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
    border-color: var(--primary);
}

.feature-card__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--muted);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
}

.feature-card__icon .material-symbols-sharp {
    font-size: 24px;
}

.feature-card__title {
    font-family: var(--font-primary);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: var(--space-2);
}

.feature-card__description {
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    color: var(--muted-foreground);
    line-height: 1.6;
}

/* ── CTA Section ── */
.cta-section {
    padding: 80px 32px;
    text-align: center;
}

.cta-card {
    max-width: 640px;
    margin: 0 auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 56px 48px;
    box-shadow: var(--shadow-card);
}

.cta-card__title {
    font-family: var(--font-primary);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: var(--space-3);
    letter-spacing: -0.01em;
}

.cta-card__description {
    font-family: var(--font-secondary);
    font-size: var(--text-lg);
    color: var(--muted-foreground);
    margin-bottom: var(--space-6);
    line-height: 1.6;
}

/* ── Public Footer ── */
.public-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
}

.public-footer__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--space-6) 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.public-footer__text {
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    color: var(--muted-foreground);
}

.public-footer__links {
    display: flex;
    gap: var(--space-6);
}

.public-footer__link {
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    color: var(--muted-foreground);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.public-footer__link:hover {
    color: var(--foreground);
}

/* ── Auth Shell ── */
.auth-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px 64px;
}

.auth-shell__container {
    width: 100%;
    max-width: 460px;
}

.auth-shell__header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-shell__title {
    font-family: var(--font-primary);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--foreground);
    letter-spacing: -0.01em;
}

.auth-shell__subtitle {
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    color: var(--muted-foreground);
    margin-top: var(--space-2);
    line-height: 1.6;
}

/* ── Auth Card ── */
.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-card);
}

.auth-card--centered {
    text-align: center;
}

.auth-card__icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-6);
}

.auth-card__icon .material-symbols-sharp {
    font-size: 32px;
}

.auth-card__icon--info {
    background: var(--color-info);
    color: var(--color-info-foreground);
}

.auth-card__icon--success {
    background: var(--color-success);
    color: var(--color-success-foreground);
}

.auth-card__icon--warning {
    background: var(--color-warning);
    color: var(--color-warning-foreground);
}

.auth-card__title {
    font-family: var(--font-primary);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: var(--space-3);
}

.auth-card__text {
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    color: var(--muted-foreground);
    line-height: 1.6;
    margin-bottom: var(--space-3);
}

.auth-card__email {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    color: var(--foreground);
    margin: var(--space-2) 0 var(--space-4);
    word-break: break-all;
}

.auth-card__help {
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    color: var(--muted-foreground);
    margin-top: var(--space-5);
}

.auth-card__help a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-card__help a:hover {
    opacity: 0.85;
}

.auth-card__footer {
    text-align: center;
    margin-top: var(--space-6);
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    color: var(--muted-foreground);
}

.auth-card__footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-card__footer-link:hover {
    opacity: 0.85;
}

.auth-card__actions {
    margin-top: var(--space-6);
}

/* ── Auth Form Cascade (Django form.as_p output) ── */
.auth-card__form p {
    margin-bottom: var(--space-5);
}

.auth-card__form p:last-of-type {
    margin-bottom: var(--space-6);
}

.auth-card__form label {
    display: block;
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: var(--space-2);
}

.auth-card__form input[type="text"],
.auth-card__form input[type="email"],
.auth-card__form input[type="password"] {
    width: 100%;
    height: 40px;
    padding: 8px 16px;
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    color: var(--foreground);
    background: var(--background);
    border: 1px solid var(--input);
    border-radius: var(--radius-pill);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-card__form input[type="text"]::placeholder,
.auth-card__form input[type="email"]::placeholder,
.auth-card__form input[type="password"]::placeholder {
    color: var(--muted-foreground);
}

.auth-card__form input[type="text"]:focus,
.auth-card__form input[type="email"]:focus,
.auth-card__form input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.15);
}

.auth-card__form .helptext {
    display: block;
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    color: var(--muted-foreground);
    margin-top: var(--space-2);
    line-height: 1.5;
}

.auth-card__form .helptext ul {
    list-style: none;
    padding: 0;
    margin-top: var(--space-1);
}

.auth-card__form .helptext li {
    position: relative;
    padding-left: var(--space-3);
    margin-bottom: 2px;
}

.auth-card__form .helptext li::before {
    content: '·';
    position: absolute;
    left: 4px;
    color: var(--muted-foreground);
    font-weight: 700;
}

.auth-card__form .errorlist {
    list-style: none;
    padding: 0;
    margin-top: var(--space-2);
}

.auth-card__form .errorlist li {
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    color: var(--color-error-foreground);
    background: var(--color-error);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-1);
}

.auth-card__submit {
    width: 100%;
}

/* ── Gate (Private Preview) ── */
.gate-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-4);
    background: var(--background);
}

.gate-card {
    width: 100%;
    max-width: 440px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 40px 32px;
    box-shadow: var(--shadow-card);
    text-align: center;
}

.gate-card__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: var(--space-6);
}

.gate-card__brand-mark {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: var(--primary-foreground);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gate-card__brand-mark .material-symbols-sharp {
    font-size: 20px;
}

.gate-card__brand-text {
    font-family: var(--font-primary);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.gate-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: var(--muted);
    color: var(--primary);
    font-family: var(--font-primary);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: var(--space-5);
}

.gate-card__title {
    font-family: var(--font-primary);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: var(--space-3);
    letter-spacing: -0.01em;
}

.gate-card__subtitle {
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    color: var(--muted-foreground);
    line-height: 1.6;
    margin-bottom: var(--space-6);
}

.gate-card__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    text-align: left;
}

.gate-card__form input[type="text"],
.gate-card__form input[type="password"] {
    width: 100%;
    height: 40px;
    padding: 8px 16px;
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    color: var(--foreground);
    background: var(--background);
    border: 1px solid var(--input);
    border-radius: var(--radius-pill);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.gate-card__form input[type="text"]::placeholder,
.gate-card__form input[type="password"]::placeholder {
    color: var(--muted-foreground);
}

.gate-card__form input[type="text"]:focus,
.gate-card__form input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.15);
}

.gate-card__error {
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    color: var(--color-error-foreground);
    margin: calc(-1 * var(--space-1)) 0 0;
}

.gate-card__footer {
    margin-top: var(--space-6);
    font-family: var(--font-primary);
    font-size: var(--text-xs);
    color: var(--muted-foreground);
    letter-spacing: 0.05em;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .provider-grid { grid-template-columns: repeat(2, 1fr); }
    .features__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .main-content { padding: 16px; }
    .stats-row { flex-direction: column; }
    .info-row { flex-direction: column; }
    .provider-grid { grid-template-columns: 1fr; }
    .status-cards { flex-direction: column; }

    .topbar__inner { padding: 0 16px; }
    .topbar__nav { gap: var(--space-3); }
    .topbar__nav-link:not(.topbar__nav-link--auth) { display: none; }
    .hero { padding: 80px 20px 48px; }
    .features { padding: 48px 20px; }
    .features__grid { grid-template-columns: 1fr; }
    .cta-section { padding: 48px 20px; }
    .cta-card { padding: 40px 28px; }
    .public-footer__inner { flex-direction: column; gap: var(--space-4); padding: var(--space-5) 20px; }
    .auth-card { padding: 28px; }
    .gate-card { padding: 36px 28px 28px; }
}
