/* clarity-auth.css v2 — styles for login, profile, intake, dashboard pages */

/* ── Auth screen container ─────────────────────────────────────── */
/* Keep author display rules from overriding HTML hidden states. */
.auth-screen[hidden],
.auth-card[hidden],
.auth-panel[hidden],
#public-screen[hidden] {
  display: none !important;
}

.auth-screen {
  min-height: calc(100vh - 74px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0 80px;
}

.auth-wrap {
  width: min(480px, calc(100% - 40px));
}

/* ── Auth card ─────────────────────────────────────────────────── */
.auth-card {
  padding: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10,21,38,.96), rgba(8,17,31,.96));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(560px 220px at 8% 0%, rgba(94,168,208,.10), transparent 60%);
  pointer-events: none;
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  position: relative;
}

.auth-logo img {
  height: 36px;
  width: auto;
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  margin: 0 0 6px;
  text-align: center;
  position: relative;
}

.auth-sub {
  font-size: 14px;
  color: var(--muted-2);
  text-align: center;
  margin: 0 0 28px;
  position: relative;
}

/* ── Tabs ──────────────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
  position: relative;
}

.auth-tab {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--muted-2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
  font-family: var(--font);
}

.auth-tab:hover { color: var(--text); background: rgba(255,255,255,.03); }
.auth-tab.active {
  color: var(--text);
  background: rgba(94,168,208,.12);
}

/* ── Form fields ───────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.auth-field input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  transition: border-color .14s ease, box-shadow .14s ease;
  outline: none;
}

.auth-field input::placeholder { color: rgba(233,238,247,.28); }

.auth-field input:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(94,168,208,.12);
}

/* ── Submit button ─────────────────────────────────────────────── */
.auth-submit {
  margin-top: 6px;
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  font-size: 14px;
  letter-spacing: .01em;
}

.auth-submit:disabled { opacity: .52; cursor: not-allowed; }

/* ── Status messages ───────────────────────────────────────────── */
.auth-error {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,80,80,.24);
  background: rgba(255,80,80,.06);
  color: rgba(255,150,150,.92);
  font-size: 14px;
  line-height: 1.55;
  display: none;
  position: relative;
}

.auth-error.visible { display: block; }

.auth-success {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(94,168,208,.24);
  background: rgba(94,168,208,.06);
  color: rgba(141,196,221,.92);
  font-size: 14px;
  line-height: 1.55;
  display: none;
  position: relative;
}

.auth-success.visible { display: block; }

/* ── Redirect / loading state ──────────────────────────────────── */
.auth-redirect {
  text-align: center;
  padding: 32px 0;
  position: relative;
}

.auth-redirect .kicker { margin-bottom: 10px; }

.auth-redirect p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

/* ── Form panel visibility ─────────────────────────────────────── */
.auth-panel { display: none; }
.auth-panel.active { display: block; }

/* ── Profile / Intake form ─────────────────────────────────────── */
.setup-screen {
  padding: 52px 0 80px;
}

.setup-wrap {
  max-width: 640px;
}

.setup-header {
  margin-bottom: 32px;
}

.setup-header h1 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--text);
  margin: 10px 0 0;
}

.setup-header p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin: 10px 0 0;
  max-width: 58ch;
}

.setup-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setup-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.setup-field label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.setup-field input,
.setup-field textarea,
.setup-field select {
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  line-height: 1.55;
  transition: border-color .14s ease, box-shadow .14s ease;
  outline: none;
}

.setup-field textarea {
  resize: vertical;
  min-height: 88px;
}

.setup-field input::placeholder,
.setup-field textarea::placeholder { color: rgba(233,238,247,.28); }

.setup-field input:focus,
.setup-field textarea:focus,
.setup-field select:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(94,168,208,.12);
}

.setup-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 6px;
}

.setup-note {
  font-size: 13px;
  color: var(--muted-2);
  margin: 0;
}

/* ── Dashboard ─────────────────────────────────────────────────── */
.dashboard-screen {
  padding: 36px 0 80px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 280px minmax(0,1fr);
  gap: 22px;
  align-items: start;
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dash-card {
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10,21,38,.94), rgba(8,17,31,.94));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.dash-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(480px 180px at 8% 0%, rgba(94,168,208,.08), transparent 60%);
  pointer-events: none;
}

.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  position: relative;
}

.dash-card-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.015em;
  color: var(--text);
}

.dash-empty {
  font-size: 14px;
  color: var(--muted-2);
  margin: 0;
  position: relative;
}

.evan-launch-btn {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  font-size: 15px;
  letter-spacing: .01em;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.history-turn {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(121,179,204,.08);
  background: rgba(255,255,255,.02);
}

.history-turn-role {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 4px;
}

.history-turn-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  /* Truncate long messages */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-turn-ts {
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 6px;
}

.profile-field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  margin-bottom: 10px;
}

.profile-field-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.profile-field-value {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.profile-field-value.empty {
  color: var(--muted-2);
  font-style: italic;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .auth-card { padding: 24px 18px; }
  .setup-screen { padding: 32px 0 60px; }
  .dashboard-screen { padding: 24px 0 60px; }
}
