/* =========================================
   Quesnly – Public Stylesheet
   DeepMind Works | contact@deepmindworks.com
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
  --color-bg: #f7f6f3;
  --color-surface: #ffffff;
  --color-surface-2: #f0eeea;
  --color-primary: #1a1a2e;
  --color-primary-hover: #16213e;
  --color-accent: #e63946;
  --color-accent-light: #fff0f1;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-border: #e2e0dc;
  --color-success: #059669;
  --color-warning: #d97706;
  --color-error: #dc2626;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.12);
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; }
a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary); }

/* ── Header ── */
.site-header {
  background: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,.2);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo img {
  height: 38px;
  width: auto;
}

.header-logo-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.header-tagline {
  font-size: 0.8rem;
  color: rgba(255,255,255,.55);
  font-weight: 400;
}

/* ── Hero Section ── */
.hero {
  background: var(--color-primary);
  color: #fff;
  padding: 56px 24px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(230,57,70,.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: rgba(230,57,70,.12);
  border: 1px solid rgba(230,57,70,.3);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-title em {
  font-style: italic;
  color: var(--color-accent);
}

.hero-description {
  font-size: 1.05rem;
  color: rgba(255,255,255,.72);
  max-width: 560px;
  margin: 0 auto 28px;
  font-weight: 300;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  color: rgba(255,255,255,.6);
}

.hero-meta-item i { color: var(--color-accent); font-size: 0.9rem; }

/* ── Progress Bar ── */
.form-progress-container {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 14px 24px;
  position: sticky;
  top: 70px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.form-progress-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.progress-bar-track {
  flex: 1;
  height: 6px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), #ff6b6b);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  width: 0%;
}

.progress-percent {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
  min-width: 36px;
  text-align: right;
}

/* ── Main Content ── */
.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Form Card ── */
.form-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 36px 20px;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, var(--color-primary) 0%, #16213e 100%);
  color: #fff;
}

.section-icon {
  width: 42px;
  height: 42px;
  background: rgba(230,57,70,.2);
  border: 1px solid rgba(230,57,70,.3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--color-accent);
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 0.82rem;
  color: rgba(255,255,255,.6);
  margin-top: 2px;
}

/* ── Form Fields ── */
.form-body { padding: 32px 36px; }

.form-group {
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.45s forwards;
}

.form-group:nth-child(1)  { animation-delay: 0.05s; }
.form-group:nth-child(2)  { animation-delay: 0.10s; }
.form-group:nth-child(3)  { animation-delay: 0.15s; }
.form-group:nth-child(4)  { animation-delay: 0.20s; }
.form-group:nth-child(5)  { animation-delay: 0.25s; }
.form-group:nth-child(6)  { animation-delay: 0.30s; }
.form-group:nth-child(7)  { animation-delay: 0.35s; }
.form-group:nth-child(8)  { animation-delay: 0.40s; }
.form-group:nth-child(9)  { animation-delay: 0.45s; }
.form-group:nth-child(10) { animation-delay: 0.50s; }
.form-group:nth-child(n+11) { animation-delay: 0.55s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: 8px;
  line-height: 1.4;
}

.form-label .req {
  color: var(--color-accent);
  margin-left: 3px;
}

.form-label .q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--color-accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  margin-right: 8px;
  flex-shrink: 0;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 5px;
}

.form-control {
  width: 100%;
  padding: 11px 15px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(230,57,70,.1);
}

.form-control.error {
  border-color: var(--color-error);
  background: #fff5f5;
}

textarea.form-control {
  resize: vertical;
  min-height: 110px;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 38px;
  cursor: pointer;
}

/* Radio / Checkbox */
.radio-group, .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-option, .checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.9rem;
  user-select: none;
}

.radio-option:hover, .checkbox-option:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.radio-option input, .checkbox-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--color-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.radio-option.selected, .checkbox-option.selected {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

/* File Upload */
.file-upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  background: var(--color-surface-2);
}

.file-upload-zone:hover, .file-upload-zone.drag-over {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.file-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-upload-icon {
  font-size: 2rem;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.file-upload-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: 5px;
}

.file-upload-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.file-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.file-item-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
}

.file-item-name i { color: var(--color-accent); }

.file-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition);
  font-size: 0.9rem;
}

.file-remove:hover {
  color: var(--color-error);
  background: #fff5f5;
}

/* Error messages */
.field-error {
  font-size: 0.8rem;
  color: var(--color-error);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.field-error i { font-size: 0.75rem; }

/* ── Divider ── */
.form-divider {
  height: 1px;
  background: var(--color-border);
  margin: 32px 0;
}

/* ── Submit Button ── */
.form-footer {
  padding: 24px 36px 36px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.form-footer-note {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}

.btn-primary:hover {
  background: #c62d39;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(230,57,70,.35);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-primary .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn-primary.loading .spinner { display: inline-block; }
.btn-primary.loading .btn-text { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Success State ── */
.submission-success {
  display: none;
  text-align: center;
  padding: 64px 36px;
}

.success-animation {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--color-success), #10b981);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  margin: 0 auto 24px;
  animation: successPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes successPop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.success-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--color-text);
  margin-bottom: 12px;
}

.success-message {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 480px;
  margin: 0 auto;
}

/* ── Toast Notification ── */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 400px;
  border-left: 4px solid var(--color-accent);
  animation: toastIn 0.35s ease;
  font-size: 0.88rem;
}

.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-error); }

.toast-icon { font-size: 1.1rem; margin-top: 2px; }
.toast.success .toast-icon { color: var(--color-success); }
.toast.error .toast-icon { color: var(--color-error); }

.toast-body { flex: 1; }
.toast-title { font-weight: 700; color: var(--color-text); margin-bottom: 2px; }
.toast-text { color: var(--color-text-muted); line-height: 1.4; }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Footer ── */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 24px;
  font-size: 0.82rem;
}

.site-footer a {
  color: rgba(255,255,255,.7);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .form-body { padding: 22px 20px; }
  .section-header { padding: 20px 20px 16px; }
  .form-footer { padding: 20px; }
  .hero { padding: 40px 20px 32px; }
  .hero-title { font-size: 1.8rem; }
  .header-tagline { display: none; }
  .form-progress-container { top: 62px; }
  .main-content { padding: 24px 16px 60px; }
}

@media (max-width: 480px) {
  .radio-group, .checkbox-group { gap: 8px; }
  .form-footer { flex-direction: column; }
  .btn-primary { width: 100%; justify-content: center; }
}
