/* =========================================================================
   SourcePhoenix platform additions: sign-in, account menu, setup note, Settings.
   Built from the RFQ desk's own variables and pieces (.btn, .q-in, .pill, .chip),
   so all three color modes carry over.
   ========================================================================= */

/* ------------------------------ sign in ------------------------------ */

.auth {
  position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 18px; overflow: hidden;
}
.auth-card {
  position: relative; z-index: 1; width: min(440px, 100%);
  background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 30px 30px 24px;
  box-shadow: 0 0 0 1px var(--halo-soft), 0 30px 80px -30px var(--halo-deep);
  animation: pop .2s ease-out;
}
@media (prefers-reduced-motion: reduce) { .auth-card { animation: none; } }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-brand img { height: 40px; width: auto; }
.auth-brand span { display: flex; flex-direction: column; line-height: 1.2; }
.auth-brand b { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.auth-brand small { font-size: 12px; color: var(--muted); }
.auth-card h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.auth-sub { color: var(--muted); font-size: 14px; margin-top: 8px; }
.auth-form { margin-top: 18px; }
.auth-form .q-field { font-size: 13px; }
.auth-form .q-in { padding: 10px 12px; font-size: 14px; }
.auth-wide { width: 100%; margin-top: 6px; }
.auth-card > .auth-wide { margin-top: 20px; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; color: var(--muted); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; text-align: center; gap: 6px 16px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.auth-msg { margin-top: 14px; padding: 10px 12px; border-radius: 12px; font-size: 13px; background: var(--accent-soft); border: 1px solid var(--line); }
.auth-msg.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--ink); }
.ws-list { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.ws-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.ws-item:hover { border-color: var(--halo); box-shadow: 0 0 18px var(--halo-soft); }
.ws-item small { color: var(--muted); text-transform: capitalize; }

/* ---------------------------- account menu ---------------------------- */

.acct { position: relative; }
.acct-btn { display: flex; align-items: center; gap: 8px; padding: 2px 4px; border-radius: 999px; }
.acct-btn:hover .acct-text b { text-decoration: underline; }
.acct-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.acct-text b { color: var(--ink); font-size: 13px; }
.acct-text small { font-size: 11px; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; min-width: 220px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 0 0 1px var(--halo-soft), 0 20px 50px -20px var(--halo-deep);
}
.acct-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--ink); }
.acct-menu button:hover { background: var(--surface-2); }
.acct-who { font-size: 12px; color: var(--muted); padding: 6px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow-wrap: anywhere; }

/* ------------------------------ setup note ------------------------------ */

.setup-note {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 18px 0 0; padding: 12px 16px; border-radius: 14px; font-size: 14px;
  background: color-mix(in srgb, var(--warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
}
.setup-note .btn { margin-left: auto; }

/* ------------------------------- settings ------------------------------- */

#settingsView { position: relative; z-index: 1; }
.s-nav { position: sticky; top: 72px; z-index: 5; padding: 8px 0; background: transparent; }
.s-nav .pill { text-decoration: none; color: var(--ink); }
.s-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 22px 24px;
  margin-bottom: 18px; scroll-margin-top: 130px;
  box-shadow: 0 0 0 1px var(--halo-soft), 0 30px 80px -40px var(--halo-deep);
}
.s-head { margin-bottom: 14px; }
.s-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.s-head p { color: var(--muted); font-size: 14px; margin-top: 4px; max-width: 46em; }
.s-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; }
.s-help { font-size: 12px; font-weight: 500; color: var(--muted); }
.s-card .row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.s-card .sub-h { margin-top: 18px; }
.s-check .check { font-size: 13px; color: var(--ink); font-weight: 600; }
.s-table { width: 100%; font-size: 14px; }
.s-table td, .s-table th { padding: 8px 10px 8px 0; vertical-align: middle; }
.s-table .owner { margin-right: 6px; }
.s-table .s-sel { width: auto; padding: 5px 8px; }
.s-off { opacity: .5; }
.s-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.s-invite span { flex: 1; min-width: 200px; }
.s-invite small { color: var(--muted); }
.s-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.s-file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.s-file b { width: 100%; }
.s-file small { width: 100%; color: var(--muted); font-size: 12px; }
.s-up { position: relative; overflow: hidden; cursor: pointer; }
.s-up input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.s-card select.q-in option { background: var(--paper); color: var(--ink); }

@media (max-width: 720px) {
  .acct-text { display: none; }
  .s-card { padding: 18px 16px; }
  .s-nav { top: 60px; }
}

/* Required settings: a dot on the Settings tab, a "Required" tag on the section pills,
   red outline on an empty required field, and a short glow on the section we jump to. */
[data-view="settings"].needs-setup { position: relative; }
[data-view="settings"].needs-setup::after {
  content: ''; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent, #EC7349); box-shadow: 0 0 0 2px var(--bg, #111);
}
.s-req { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 600;
  letter-spacing: .02em; color: #1a0d07; background: var(--accent, #EC7349); vertical-align: 1px; }
.q-in.invalid, input.invalid { border-color: #ff6b6b !important; box-shadow: 0 0 0 3px rgba(255, 107, 107, .18) !important; }
.s-card.s-flash { box-shadow: 0 0 0 2px var(--neon-green, #39F58A); transition: box-shadow .3s; }
