/* Pool Agent Portal — Stylesheet */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #1a6fdb;
  --blue-dark: #1458b0;
  --blue-light: #e8f1fb;
  --green: #19a34a;
  --red: #d93025;
  --orange: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --white: #ffffff;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: var(--blue);
  color: var(--white);
  padding: 16px 24px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.logo { font-size: 1.4rem; font-weight: 700; }
.tagline { font-size: 0.9rem; opacity: 0.85; }

/* Main */
main {
  flex: 1 0 auto;   /* grow but never shrink — lets content overflow correctly */
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--blue-light);
}
.card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-600);
  margin: 16px 0 10px;
}
.hint { font-size: 0.85rem; color: var(--gray-400); margin-bottom: 14px; }
.optional { font-weight: 400; font-size: 0.85rem; color: var(--gray-400); }

/* Grid layouts */
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Form fields */
.field { display: flex; flex-direction: column; gap: 4px; }
label { font-size: 0.85rem; font-weight: 600; color: var(--gray-600); }
.req { color: var(--red); }
input[type="text"],
input[type="email"],
input[type="number"] {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.95rem;
  color: var(--gray-800);
  transition: border-color 0.15s;
  width: 100%;
}
input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 111, 219, 0.12);
}
input:invalid:not(:placeholder-shown) { border-color: var(--red); }

/* Pool type selector */
.pool-type-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.pool-type-option { cursor: pointer; }
.pool-type-option input[type="radio"] { display: none; }
.option-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 24px;
  transition: border-color 0.15s, background 0.15s;
  min-width: 130px;
}
.option-icon { font-size: 1.8rem; }
.option-label { font-size: 0.9rem; font-weight: 600; color: var(--gray-600); }
.pool-type-option input:checked + .option-box {
  border-color: var(--blue);
  background: var(--blue-light);
}
.pool-type-option:hover .option-box { border-color: var(--blue); }

/* Hidden sections */
.hidden { display: none !important; }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone:hover { border-color: var(--blue); background: var(--blue-light); }
.drop-zone.drag-over { border-color: var(--blue); background: var(--blue-light); }
.drop-zone.file-selected { border-color: var(--green); background: #f0fdf4; }
.drop-icon { font-size: 2.5rem; margin-bottom: 10px; }
.drop-text { font-size: 1rem; color: var(--gray-600); }
.drop-subtext { font-size: 0.8rem; color: var(--gray-400); margin-top: 6px; }
.file-info {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--green);
  font-weight: 600;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  display: inline-block;
  background: var(--white);
  color: var(--blue);
  border: 2px solid var(--blue);
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--blue-light); }

.btn-planset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0e4d2e;
  color: var(--white);
  border: 2px solid #0e4d2e;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  margin-left: 10px;
}
.btn-planset:hover { background: #0a3820; border-color: #0a3820; }

.submit-row { text-align: center; margin: 8px 0 24px; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: 6px; margin-bottom: 18px; font-size: 0.95rem; }
.alert-error { background: #fef2f2; border: 1px solid #fca5a5; color: var(--red); }

/* Status tracker */
.status-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 28px 0 20px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid var(--gray-200);
  background: var(--white);
  transition: background 0.3s, border-color 0.3s;
}
.step.active .step-dot {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(26, 111, 219, 0.2);
  animation: pulse 1.5s ease-in-out infinite;
}
.step.done .step-dot {
  border-color: var(--green);
  background: var(--green);
}
.step-label { font-size: 0.8rem; font-weight: 600; color: var(--gray-400); white-space: nowrap; }
.step.active .step-label { color: var(--blue); }
.step.done .step-label { color: var(--green); }
.step-line {
  flex: 1;
  height: 3px;
  background: var(--gray-200);
  min-width: 60px;
  max-width: 120px;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(26, 111, 219, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(26, 111, 219, 0.05); }
}

/* Status message */
.status-message { text-align: center; margin: 12px 0 20px; font-size: 1rem; color: var(--gray-600); }
.error-text { color: var(--red); }

/* Meta grid */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  font-size: 0.9rem;
  margin-bottom: 8px;
  padding: 14px;
  background: var(--gray-50);
  border-radius: 6px;
}
code { font-family: monospace; background: var(--gray-100); padding: 1px 5px; border-radius: 3px; }

/* Actions */
.actions { text-align: center; margin-top: 20px; }

/* Footer */
footer {
  text-align: center;
  padding: 16px;
  font-size: 0.8rem;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
  background: var(--white);
}


/* Progress spinner */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  padding: 8px 0;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 4px solid #e0e7ef;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Missing fields input form */
.missing-fields-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}
.missing-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.missing-field label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
}
.missing-field input {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
}
.missing-field input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
