/* =========================================================================
 * tool.css  —  RFP Document Tool styles (uses shared theme tokens)
 * Version: 2025-09-26-portal-theme-3
 *
 * NOTE:
 *   - This file assumes /shared/static/css/portal.css is ALSO loaded.
 *   - Colors are driven by CSS variables declared in portal.css.
 *   - Do not set body background here; inherit from shared theme.
 * ========================================================================= */

:root { /* nothing here on purpose; theme comes from portal.css */ }

/* Layout inside the main area */
.tool-wrap {
  width: 100%;
  max-width: 1100px;
  margin: 22px auto 24px;
  padding: 0 18px;
}

.tool-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  color: var(--text);
}

/* Title/lead text */
.tool-card h1 { margin: 0 0 10px; font-size: 22px; color: var(--text); }
.tool-card p.lead { margin: 6px 0 16px; color: var(--text-muted); }

/* Two-column form grid on wide; single on narrow */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}
@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* Full-width rows */
.full-width {
  grid-column: 1 / -1;
}

/* Inputs */
.form-group { display: flex; flex-direction: column; }
.form-group label { font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-group small { color: var(--text-muted); margin-top: 6px; }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in oklab, var(--surface) 98%, white 0%);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.form-group input[type="file"] {
  background: transparent;
  border: 1px dashed var(--border);
}

/* Focus ring */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: color-mix(in oklab, var(--accent) 70%, var(--border) 30%);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 30%, transparent 70%);
}

/* Actions */
.button-center {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

button,
.button {
  appearance: none;
  border: 1px solid color-mix(in oklab, var(--accent) 40%, var(--border) 60%);
  background: color-mix(in oklab, var(--accent) 25%, var(--panel) 75%);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s ease, transform .04s ease, border-color .15s ease;
}
button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
button[disabled] { opacity: .6; cursor: not-allowed; }

/* Status views */
#progress-container,
#email-queued-container,
#completion-container,
#error-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  color: var(--text);
  margin-top: 18px;
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 4px solid color-mix(in oklab, var(--text-muted) 60%, transparent 40%);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
  margin: 12px auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Back to main button that lives in the left sidebar (styled by portal.css links).
   If you show it inside the tool card as well, this keeps it consistent. */
.back-btn {
  text-decoration: none;
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--panel) 95%, black 0%);
  color: var(--text);
}
.back-btn:hover {
  background: color-mix(in oklab, var(--panel) 90%, white 6%);
}

/* Links */
a { color: var(--link); }
a:hover { text-decoration: underline; }
