/* WCA Case Organiser — private tool styles
   Extends style.css. Load both. */

/* ── Auth pages (login, register, subscribe) ── */
.auth-wrap {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.auth-box {
  width: 100%;
  max-width: 420px;
  background: #FAF8F5;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem 2rem 2.25rem;
}

.auth-box h1 {
  font-size: clamp(1.3rem, 4vw, 1.65rem);
  margin-bottom: 0.25rem;
}

.auth-box .auth-sub {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

.auth-box .field {
  margin-bottom: 1.1rem;
}

.auth-box label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 0.35rem;
}

.auth-box input[type="email"],
.auth-box input[type="password"],
.auth-box input[type="text"],
.auth-box textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
}

.auth-box input:focus,
.auth-box textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.auth-box .btn-full {
  width: 100%;
  text-align: center;
  margin-top: 0.5rem;
}

.auth-box .auth-switch {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-soft);
}

.auth-status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  min-height: 1.2em;
}
.auth-status--ok  { color: #2a6e3f; }
.auth-status--err { color: #8b2020; }

/* ── Organiser layout ── */
.org-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

.org-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg);
  padding: 1.5rem 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.org-sidebar nav {
  display: flex;
  flex-direction: column;
}

.org-sidebar nav a {
  display: block;
  padding: 0.6rem 1.5rem;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  transition: color 0.1s, border-color 0.1s;
}

.org-sidebar nav a:hover,
.org-sidebar nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-lt);
}

.org-sidebar .sidebar-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 1rem 1.5rem 0.35rem;
}

.org-main {
  flex: 1;
  padding: 2rem 1.5rem;
  max-width: 760px;
}

@media (max-width: 640px) {
  .org-layout { flex-direction: column; }
  .org-sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 60px;
    z-index: 90;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    background: var(--bg);
  }
  .org-sidebar .sidebar-label {
    display: none !important;
  }
  .org-sidebar nav {
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0.75rem;
    gap: 0.5rem;
  }
  .org-sidebar nav::-webkit-scrollbar {
    display: none;
  }
  .org-sidebar nav a {
    display: inline-block;
    flex-shrink: 0;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    font-size: 0.8rem;
    border-left: none !important;
    border-bottom: none !important;
  }
  .org-sidebar nav a.active {
    background: var(--accent);
    color: #fff !important;
    border-color: var(--accent);
  }
  .org-main {
    padding: 1.5rem 1rem;
  }
}

/* ── Dashboard widgets ── */
.org-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  margin-top: 1.5rem;
}

@media (min-width: 500px) {
  .org-grid { grid-template-columns: 1fr 1fr; }
}

.org-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  background: #FAF8F5;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.org-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(44, 74, 124, 0.08);
  transform: translateY(-2px);
  opacity: 1;
}

.org-card__icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.org-card h3 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.org-card p {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 0;
}

/* ── Case file form ── */
.case-field {
  margin-bottom: 1.5rem;
}

.case-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.case-field input,
.case-field textarea,
.case-field select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}

.case-field input:focus,
.case-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.save-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.75rem;
}

.save-bar .save-status {
  font-size: 0.875rem;
  color: var(--text-soft);
}

/* ── Dates list ── */
.dates-list {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.date-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.date-item__val {
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
  font-size: 0.875rem;
  flex-shrink: 0;
  min-width: 6rem;
}

.date-item__label { flex: 1; font-family: var(--font-serif); }
.date-item__note { font-size: 0.85rem; color: var(--text-soft); }

.date-item__del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
}
.date-item__del:hover { color: #8b2020; }

/* ── Date add form ── */
.add-date-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: var(--bg-alt);
  border-radius: 6px;
  border: 1px solid var(--border);
}

@media (min-width: 500px) {
  .add-date-form { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
  .add-date-form .field-date { flex: 0 0 140px; }
  .add-date-form .field-label { flex: 1; }
}

/* ── Documents ── */
.doc-list {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.doc-item__name { flex: 1; font-size: 0.9rem; word-break: break-all; }
.doc-item__size { font-size: 0.8rem; color: var(--text-soft); flex-shrink: 0; }

.doc-item__del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.8rem;
}
.doc-item__del:hover { color: #8b2020; }

.upload-area {
  margin-top: 1.25rem;
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 2rem;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.upload-area:hover { border-color: var(--accent); }
.upload-area input[type="file"] { display: none; }

/* ── AI chat ── */
.ai-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
  max-height: 55vh;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.ai-msg {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ai-msg--user .ai-msg__body {
  background: var(--accent-lt);
  border: 1px solid var(--border);
  align-self: flex-end;
}

.ai-msg--assistant .ai-msg__body {
  background: #fff;
  border: 1px solid var(--border);
}

.ai-msg__body {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.65;
  max-width: 90%;
  white-space: pre-wrap;
}

.ai-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.ai-input-row textarea {
  flex: 1;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  resize: none;
  min-height: 60px;
  max-height: 180px;
  color: var(--text);
  background: var(--bg);
}

.ai-input-row textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ai-disclaimer {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-alt);
  border-radius: 4px;
  border-left: 3px solid var(--border);
}

/* ── Checklist ── */
.checklist-group {
  margin-bottom: 2rem;
}

.checklist-group h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.checklist {
  list-style: none;
  padding: 0;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.checklist li:last-child { border-bottom: none; }

.checklist input[type="checkbox"] {
  margin-top: 0.25rem;
  flex-shrink: 0;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.checklist label {
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1.5;
}

.checklist li.done label {
  text-decoration: line-through;
  color: var(--text-soft);
}

/* ── Pricing / subscribe ── */
.pricing-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (min-width: 600px) {
  .pricing-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

.price-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  background: #FAF8F5;
}

.price-card--featured {
  border-color: var(--accent);
  background: var(--accent-lt);
}

.price-card__name {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.price-card__amount {
  font-size: 2rem;
  font-family: var(--font-serif);
  margin-bottom: 0.25rem;
}

.price-card__period {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 1.25rem;
}

.price-card__features {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.price-card__features li {
  padding: 0.3rem 0;
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0;
}

.price-card__features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
}
