/* Bronco Collab — surface aesthetic.
   Linear/Vercel-style cards on a near-white canvas, bronco orange as the
   load-bearing accent. Light-mode tokens only for now; dark-mode wires in
   next pass. Used by the landing page first; desk follows. */

:root {
    --bg:              #fafafa;
    --surface:         #ffffff;
    --border:          #e5e5e5;
    --border-strong:   #d4d4d4;
    --text:            #111111;
    --text-muted:      #666666;
    --text-faint:      #a3a3a3;
    --accent:          #d35400;
    --accent-hover:    #b8480a;
    --focus-ring:      rgba(211, 84, 0, 0.30);

    --error-bg:        #fef2f2;
    --error-border:    #fecaca;
    --error-text:      #991b1b;

    --radius-sm:       6px;
    --radius:          8px;
    --radius-lg:       12px;

    --shadow-card:     0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-modal:    0 8px 24px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] {
    --bg:              #0a0a0a;
    --surface:         #161616;
    --border:          #2a2a2a;
    --border-strong:   #404040;
    --text:            #fafafa;
    --text-muted:      #a3a3a3;
    --text-faint:      #525252;
    --accent:          #f06520;
    --accent-hover:    #ff7430;
    --focus-ring:      rgba(240, 101, 32, 0.35);

    --error-bg:        #2a0a0a;
    --error-border:    #5c1414;
    --error-text:      #fca5a5;
}

.surface-body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.surface-link {
    color: var(--accent);
    text-decoration: none;
}
.surface-link:hover { color: var(--accent-hover); }

.surface-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.surface-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.surface-btn-primary {
    background: var(--accent);
    color: #fff;
}
.surface-btn-primary:hover { background: var(--accent-hover); }
.surface-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Landing page — single centered sign-in card */
.landing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.landing-card {
    max-width: 26rem;
    width: 100%;
    text-align: center;
    padding: 40px 32px;
}
.landing-card h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}
.landing-card .tag {
    margin: 0 0 28px;
    color: var(--text-muted);
    font-size: 15px;
}
.landing-card .surface-btn {
    padding: 0.75rem 1.4rem;
    font-size: 15px;
}

/* Desk page */
.desk-header {
    width: 100%;
    max-width: 64rem;
    margin: 0 auto;
    padding: 2rem 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.desk-header .who {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 15px;
    font-weight: 500;
}
.desk-header .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
}
.desk-header .signout {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
}
.desk-header .signout:hover { color: var(--text); }

.desk {
    max-width: 64rem;
    margin: 2.5rem auto 0;
    padding: 0 1.25rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}
.desk-section h2 {
    margin: 0 0 0.85rem;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.desk-empty {
    margin: 0;
    color: var(--text-faint);
    font-size: 14px;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: border-color 0.12s ease;
    min-height: 8.5rem;
}
.tile:hover { border-color: var(--border-strong); }
.tile-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}
.tile-meta {
    font-size: 13px;
    color: var(--text-muted);
}
.tile-time {
    margin-top: auto;
    font-size: 12px;
    color: var(--text-faint);
}

.tile-create {
    border-style: dashed;
    border-color: var(--border-strong);
    color: var(--text-muted);
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.4rem;
}
.tile-create .plus {
    font-size: 32px;
    line-height: 1;
    color: var(--text-faint);
    font-weight: 300;
}
.tile-create:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.tile-create:hover .plus { color: var(--accent); }

/* Secondary-page header (used by forms like /projects/new) */
.page-header {
    width: 100%;
    max-width: 36rem;
    margin: 2rem auto 1.5rem;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 14px;
}
.page-header a {
    color: var(--text-muted);
    text-decoration: none;
}
.page-header a:hover { color: var(--text); }

/* Forms */
.surface-form {
    max-width: 36rem;
    margin: 0 auto;
}
.form-title {
    margin: 0 0 1.5rem;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}
.form-field { margin-bottom: 1.25rem; }
.form-field-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.form-field-row .form-field {
    flex: 1;
    margin-bottom: 0;
}
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.surface-input,
.surface-select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.surface-input:focus,
.surface-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Pill radio groups (flavor picker, type picker, etc.) */
.pill-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.pill-group > input[type=radio] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.pill-group label.pill {
    flex: 1;
    min-width: 6rem;
    text-align: center;
    padding: 0.55rem 0.75rem;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease;
}
.pill-group label.pill:hover { border-color: var(--border-strong); }
.pill-group input[type=radio]:checked + label.pill {
    border-color: var(--accent);
    color: var(--accent);
}
.pill-group label.pill.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    color: var(--text-faint);
}
.pill-group label.pill.disabled:hover { border-color: var(--border); }
.pill-group label.pill small {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    margin-top: 2px;
}

/* Inline time-signature row (num / denom) */
.ts-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ts-row .surface-input,
.ts-row .surface-select { max-width: 5rem; }
.ts-row .ts-slash {
    color: var(--text-muted);
    font-size: 18px;
}

/* Form actions row */
.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1.75rem;
}
.form-actions .cancel-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
}
.form-actions .cancel-link:hover { color: var(--text); }

/* Inline form errors */
.form-errors {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    margin-bottom: 1.25rem;
    color: var(--error-text);
    font-size: 14px;
}
.form-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Theme toggle button (sun / moon icons swap by data-theme) */
.theme-toggle {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.theme-toggle:hover {
    color: var(--text);
    border-color: var(--border);
}
.theme-toggle-moon { display: block; }
.theme-toggle-sun  { display: none; }
[data-theme="dark"] .theme-toggle-moon { display: none; }
[data-theme="dark"] .theme-toggle-sun  { display: block; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

/* S&S DAW brand mark — same word-mark used on the chassis top bar, adapted
   for the surface aesthetic. Carries Lexend Peta over for brand continuity. */
.surface-brand {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    font-family: 'Lexend Peta', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
}
.surface-brand:hover { color: var(--accent-hover); }

/* Modal overlay + card. Hidden by default; opens via [data-modal-open],
   closes via [data-modal-close], Esc, or click-outside (handled in
   /js/modal.js). Tabs swap visible panel via [data-tab] → [data-panel]. */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.modal-overlay.is-open { display: flex; }

.modal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-modal);
    max-width: 32rem;
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    position: relative;
    color: var(--text);
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
}

.modal-close {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    background: none;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 20px;
    line-height: 1;
    padding: 0;
}
.modal-close:hover { color: var(--text); background: var(--border); }

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding-right: 2.5rem; /* leave room for the close button */
}
.modal-tab {
    background: none;
    border: 0;
    padding: 0.95rem 1.1rem;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.modal-tab:hover { color: var(--text); }
.modal-tab.is-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.modal-tab-panel {
    display: none;
    padding: 1.5rem;
}
.modal-tab-panel.is-active { display: block; }

/* Read-only copy field used in invite UIs */
.copy-row {
    display: flex;
    gap: 0.5rem;
}
.copy-row .surface-input { flex: 1; font-family: 'JetBrains Mono', 'SF Mono', monospace; font-size: 13px; }
.copy-row .surface-btn   { flex: 0 0 auto; }

.surface-btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
}
.surface-btn-secondary:hover {
    border-color: var(--text-muted);
}

/* Voice-channel quick-pick (Add Users tab, Activity only) */
.vc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.vc-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0;
    border-top: 1px solid var(--border);
}
.vc-row:first-child { border-top: 0; }
.vc-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}
.vc-name {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vc-add {
    padding: 0.3rem 0.7rem;
    font-size: 13px;
}
.vc-add[disabled] { opacity: 0.7; cursor: default; }
