/* Createrun Identity — non-utility styles. Tailwind handles layout/spacing;
   this file holds component-level rules that map cleanly onto reusable bits.
   Visual reference: Vercel / Stripe / Linear auth surfaces. */

:root {
    /* Brand / slate aliases now resolve to the shared ecosystem tokens
       (design-tokens.css, linked before this file in _Layout.cshtml) so IDM
       matches Editor / Store / Web.Base. Fallbacks keep IDM self-contained if
       design-tokens.css ever fails to load. --brand-600 is the primary brand
       (#2563EB), --brand-700 the active/hover shade — mapped to --cr-brand-700.
       Tint shades (50/100/200/500) have no shared token and stay literal. */
    --brand-50:  #EFF6FF;
    --brand-100: #DBEAFE;
    --brand-200: #BFDBFE;
    --brand-500: #3B82F6;
    --brand-600: var(--cr-brand, #2563EB);
    --brand-700: var(--cr-brand-700, #1D4ED8);

    --slate-50:  var(--cr-bg, #F8FAFC);
    --slate-100: #F1F5F9;
    --slate-200: var(--cr-border, #E2E8F0);
    --slate-300: #CBD5E1;
    --slate-400: #94A3B8;
    --slate-500: var(--cr-text-muted, #64748B);
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-900: var(--cr-text, #0F172A);

    --rim:        0 0 0 1px rgb(15 23 42 / 0.05);
    --shadow-sm:  0 1px 2px 0 rgb(15 23 42 / 0.04);
    --shadow-md:  0 6px 24px -6px rgb(15 23 42 / 0.08);
}

html { -webkit-text-size-adjust: 100%; }
body { letter-spacing: -0.005em; }

/* Subtle gradient breathes life into the empty surface around the card
   without competing with brand color on the form itself. */
body.idm-surface {
    background:
        radial-gradient(ellipse 70% 50% at 50% -10%, rgba(37, 99, 235, 0.06), transparent 70%),
        var(--slate-50);
}

/* ── Card ──────────────────────────────────────────────────────────────────
   Shadow-rim instead of a hard border: the card reads as "lifted" without
   adding a heavy stroke that competes with form fields below. */
.idm-card {
    width: 100%;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
    background: #FFFFFF;
    border-radius: 14px;
    padding: 1.85rem;
    box-shadow: var(--shadow-sm), var(--shadow-md), var(--rim);
}

@media (min-width: 640px) {
    .idm-card {
        padding: 2.15rem 2.25rem;
    }
}

/* ── Form primitives ─────────────────────────────────────────────────────── */
.idm-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--slate-200);
    border-radius: 9px;
    background: #FFFFFF;
    font-size: 14.5px;
    line-height: 1.4;
    color: var(--slate-900);
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.idm-input::placeholder { color: var(--slate-400); }

.idm-input:hover:not(:focus):not([aria-invalid="true"]) {
    border-color: var(--slate-300);
}

.idm-input:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px rgb(37 99 235 / 0.10);
}

.idm-input[aria-invalid="true"] {
    border-color: #EF4444;
    box-shadow: 0 0 0 4px rgb(239 68 68 / 0.08);
}

.idm-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 13px;
    font-weight: 500;
    color: var(--slate-700);
}

.idm-helper {
    margin-top: 0.4rem;
    font-size: 12px;
    color: var(--slate-500);
    line-height: 1.55;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.idm-btn-primary {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--brand-600);
    color: #FFFFFF;
    border: 0;
    border-radius: 9px;
    font-weight: 500;
    font-size: 14.5px;
    line-height: 1.25;
    cursor: pointer;
    transition: background-color 0.15s, box-shadow 0.15s, transform 0.06s;
    box-shadow: 0 1px 2px 0 rgb(37 99 235 / 0.18);
}

.idm-btn-primary:hover  { background: var(--brand-700); box-shadow: 0 2px 8px -2px rgb(37 99 235 / 0.35); }
.idm-btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 2px 0 rgb(37 99 235 / 0.18); }
.idm-btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 4px rgb(37 99 235 / 0.25); }
.idm-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.idm-btn-secondary {
    padding: 0.65rem 1rem;
    background: #FFFFFF;
    color: var(--slate-700);
    border: 1px solid var(--slate-200);
    border-radius: 9px;
    font-size: 14.5px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

.idm-btn-secondary:hover {
    border-color: var(--slate-300);
    color: var(--slate-900);
    background: var(--slate-50);
}

.idm-link {
    color: var(--brand-600);
    font-weight: 500;
    transition: color 0.15s;
}
.idm-link:hover { color: var(--brand-700); text-decoration: underline; text-underline-offset: 2px; }

/* ── Hero CTA buttons (centred, equal-width, no-wrap) ────────────────────── */
.idm-btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 9rem;
    height: 2.5rem;
    padding: 0 1.4rem;
    border-radius: 9px;
    font-weight: 500;
    font-size: 14.5px;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.idm-btn-cta-primary {
    background: var(--brand-600);
    color: #FFFFFF;
    border: 1px solid var(--brand-600);
    box-shadow: 0 1px 2px 0 rgb(37 99 235 / 0.18);
}
.idm-btn-cta-primary:hover { background: var(--brand-700); border-color: var(--brand-700); box-shadow: 0 2px 8px -2px rgb(37 99 235 / 0.35); }

.idm-btn-cta-secondary {
    background: #FFFFFF;
    color: var(--slate-900);
    border: 1px solid var(--slate-200);
}
.idm-btn-cta-secondary:hover { border-color: var(--slate-300); background: var(--slate-50); }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.idm-alert {
    display: flex;
    gap: 0.55rem;
    padding: 0.7rem 0.85rem;
    border-radius: 9px;
    border: 1px solid transparent;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 1rem;
}

.idm-alert-error   { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.idm-alert-success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.idm-alert-info    { background: var(--brand-50); border-color: var(--brand-200); color: #1E3A8A; }
.idm-alert-warning { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }

/* ── Status pill ─────────────────────────────────────────────────────────── */
.idm-status-active {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.5rem 0.15rem 0.45rem;
    border-radius: 999px;
    background: #ECFDF5;
    color: #047857;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #A7F3D0;
}
.idm-status-active::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 0 0 rgb(16 185 129 / 0.5);
    animation: idm-pulse 2.4s ease-in-out infinite;
}
@keyframes idm-pulse {
    0%   { box-shadow: 0 0 0 0 rgb(16 185 129 / 0.5); }
    70%  { box-shadow: 0 0 0 6px rgb(16 185 129 / 0); }
    100% { box-shadow: 0 0 0 0 rgb(16 185 129 / 0); }
}

.idm-status-muted {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--slate-100);
    color: var(--slate-600);
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--slate-200);
    text-transform: lowercase;
}

/* ── Section heading on Sessions / list pages ────────────────────────────── */
.idm-section-heading {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-500);
}

/* ── Scope chips ─────────────────────────────────────────────────────────── */
.idm-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    background: var(--slate-50);
    color: var(--slate-700);
    border: 1px solid var(--slate-200);
    font-size: 11px;
    font-weight: 500;
}

/* ── Markdown body — used by /content/{slug} ─────────────────────────────── */
.idm-prose { color: #1E293B; line-height: 1.7; font-size: 15px; }
.idm-prose h1, .idm-prose h2, .idm-prose h3 { font-weight: 600; color: var(--slate-900); letter-spacing: -0.012em; }
.idm-prose h1 { font-size: 1.6rem; margin: 1.5rem 0 0.85rem; }
.idm-prose h2 { font-size: 1.25rem; margin: 1.75rem 0 0.6rem; }
.idm-prose h3 { font-size: 1.05rem; margin: 1.25rem 0 0.5rem; }
.idm-prose p, .idm-prose ul, .idm-prose ol { margin: 0.85rem 0; }
.idm-prose ul, .idm-prose ol { padding-left: 1.5rem; }
.idm-prose ul { list-style: disc; }
.idm-prose ol { list-style: decimal; }
.idm-prose code { background: var(--slate-100); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.85em; }
.idm-prose a { color: var(--brand-600); text-underline-offset: 2px; }
.idm-prose a:hover { text-decoration: underline; }
.idm-prose blockquote {
    margin: 1rem 0; padding: 0.6rem 1rem;
    background: var(--slate-50);
    border-left: 3px solid var(--brand-600);
    color: var(--slate-600);
    border-radius: 0 6px 6px 0;
}
.idm-prose hr { border: 0; border-top: 1px solid var(--slate-200); margin: 1.5rem 0; }
.idm-prose table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; }
.idm-prose th, .idm-prose td {
    border: 1px solid var(--slate-200);
    padding: 0.4rem 0.6rem;
    text-align: left;
}
.idm-prose th { background: var(--slate-50); font-weight: 600; }

/* ── Origin pill ─────────────────────────────────────────────────────────── */
.idm-origin-pill {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.8rem;
    background: var(--slate-50);
    border-radius: 10px;
    margin-bottom: 1.4rem;
}

/* ── User-pill (header) ──────────────────────────────────────────────────── */
.idm-user-pill { transition: background-color 0.15s; }
.idm-user-pill::-webkit-details-marker { display: none; }
