/* FR Prompt (GDS Fare Rules AI Prompt Generator): page styles. The app shell (scroll area, footer row, right-hand ad column) is shared with the rest of ACES: /assets/css/tools-shell.css, site-footer.css, ads.css */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-color: #f1f5f9;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

html, body {
  background-color: var(--bg-color);
  color: var(--text-main);
}

.app-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;                 /* fills the tool page area of the ACES shell (/assets/css/tools-shell.css) */
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.75rem;
  gap: 0.75rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.75rem;
  background: var(--card-bg);
  border-radius: 6px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

header h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

header p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
}

.card {
  background: var(--card-bg);
  border-radius: 6px;
  padding: 0.85rem;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card h2 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--bg-color);
  color: var(--text-main);
  flex-shrink: 0;
}

.form-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

label {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--text-main);
}

label .req {
  color: var(--error);
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.82rem;
  background-color: #fff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.radio-container {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #f8fafc;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
}

.fare-rules-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100px;
}

.fare-rules-group textarea {
  flex: 1;
  resize: none;
  font-family: monospace;
  font-size: 0.78rem;
}

.btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
  flex-shrink: 0;
}

.btn:hover {
  background-color: var(--primary-hover);
}

.btn:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: #475569;
  margin-top: 0.5rem;
}

.btn-secondary:hover {
  background-color: #334155;
}

.btn-success-state {
  background-color: var(--success) !important;
}

.output-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.output-area {
  flex: 1;
  width: 100%;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  background-color: #0f172a;
  color: #38bdf8;
  padding: 0.75rem;
  border-radius: 4px;
  overflow-y: auto;
  white-space: pre-wrap;
  resize: none;
  border: 1px solid #1e293b;
}

/* TOAST NOTIFICATION STYLING */
.toast-container {
  position: fixed;
  bottom: calc(var(--foot-h, 36px) + 1rem);   /* bottom-left, above the footer, so a toast never covers the ad column (same as the ACES app) */
  left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 9999;
  pointer-events: none;
}

.toast-msg {
  pointer-events: auto;
  min-width: 250px;
  max-width: 380px;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.2s, transform 0.2s;
}

.toast-msg.success { background-color: var(--success); }
.toast-msg.warning { background-color: var(--warning); }
.toast-msg.error { background-color: var(--error); }

.toast-msg.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Phones and narrow windows: the original layout is two fixed columns that fit one screen; here they stack and the page scrolls. */
@media (max-width: 768px) {
  .app-wrapper { height: auto; min-height: 100%; }
  .main-grid { grid-template-columns: 1fr; }
  .main-grid > .card { min-height: 70vh; }
  .toast-container { left: 0.75rem; right: 0.75rem; }
  .toast-msg { max-width: none; min-width: 0; }
}