/* ==========================================================================
   #PreMarriageTalk — Form & Survey Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,400&family=Quicksand:wght@500;600;700&display=swap');

:root {
  /* PMT Brand Palette */
  --pmt-teal-50: #e6f7f7;
  --pmt-teal-100: #b3ecec;
  --pmt-teal-500: #1aadad;
  --pmt-teal-600: #0d8f8f;
  --pmt-teal-700: #007070;
  --pmt-teal-800: #005252;
  
  --pmt-coral-500: #b85042;
  --pmt-coral-600: #9e3d30;
  --pmt-amber-500: #d97706;
  
  --bg-page: #f6f8f8;
  --bg-card: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;
  
  --border-color: #e5e7eb;
  --border-focus: #0d8f8f;
  --border-error: #ef4444;
  --bg-error: #fef2f2;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding: 24px 16px 80px 16px;
  background-image: 
    radial-gradient(at 0% 0%, rgba(13, 143, 143, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(184, 80, 66, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Top Progress Bar */
.form-progress-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(13, 143, 143, 0.12);
  z-index: 100;
}
.form-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pmt-teal-500), var(--pmt-teal-600));
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Container */
.form-container {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Setup Banner / Alert */
.setup-alert-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 5px solid var(--pmt-amber-500);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  animation: slideDown 0.3s ease-out;
}
.setup-alert-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: #92400e;
}
.setup-alert-content .icon {
  font-size: 1.25rem;
}
.btn-setup-guide {
  background: var(--pmt-amber-500);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-setup-guide:hover {
  background: #b45309;
}

/* Form Cards */
.form-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 30px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.form-card:hover {
  box-shadow: var(--shadow-md);
}

.form-card.card-focused {
  border-color: var(--pmt-teal-600);
  box-shadow: 0 0 0 3px rgba(13, 143, 143, 0.12), var(--shadow-md);
}

.form-card.card-error {
  border-color: var(--border-error);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  animation: shake 0.4s ease-in-out;
}

/* Header Card */
.form-header-card {
  border-top: 8px solid var(--pmt-teal-600);
  padding-top: 32px;
  overflow: hidden;
}

.form-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--pmt-teal-50);
  color: var(--pmt-teal-700);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.form-brand-badge img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.form-title {
  font-size: 1.85rem;
  font-weight: 800;
  background: linear-gradient(135deg, #0d8f8f 0%, #1aadad 45%, #007070 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: var(--pmt-teal-700); /* Fallback */
  line-height: 1.3;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  display: inline-block;
}

.form-description {
  font-size: 0.975rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  white-space: pre-line;
}

.form-meta-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  font-size: 0.85rem;
  color: #e11d48;
  font-weight: 500;
}

.form-meta-indicator .sheet-sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--pmt-teal-700);
  font-weight: 500;
  font-size: 0.8rem;
  background: var(--pmt-teal-50);
  padding: 3px 10px;
  border-radius: 999px;
}
.sheet-sync-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
}

/* Question Header */
.question-header {
  margin-bottom: 16px;
}

.question-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.question-number {
  color: var(--pmt-teal-600);
  font-weight: 700;
  min-width: 22px;
}

.required-star {
  color: #ef4444;
  margin-left: 4px;
  font-weight: 700;
}

.question-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 6px;
  margin-left: 28px;
  line-height: 1.5;
}

.question-body {
  margin-left: 28px;
  margin-top: 16px;
}

@media (max-width: 600px) {
  .form-card {
    padding: 22px 18px;
  }
  .form-title {
    font-size: 1.5rem;
  }
  .question-description, .question-body {
    margin-left: 0;
  }
  .scale-options {
    gap: 8px;
    justify-content: space-between;
  }
  .scale-chip {
    width: 42px;
    height: 42px;
    min-width: 42px;
    max-width: 42px;
    font-size: 0.95rem;
  }
}

/* Form Inputs - Text, Email, Phone, Date, Dropdown */
.form-input, .form-textarea, .form-select {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #fafbfc;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--pmt-teal-600);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(13, 143, 143, 0.12);
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

/* Radio & Checkbox Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}

.option-item:hover {
  background-color: #f3f4f6;
}

.option-item.selected {
  background-color: var(--pmt-teal-50);
  border-color: var(--pmt-teal-100);
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--pmt-teal-600);
  cursor: pointer;
  flex-shrink: 0;
}

.option-label {
  font-size: 0.95rem;
  color: var(--text-main);
  flex-grow: 1;
  cursor: pointer;
}

/* "Lainnya" Other Input option */
.other-option-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.other-text-input {
  flex-grow: 1;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  outline: none;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.other-text-input:focus {
  border-color: var(--pmt-teal-600);
  box-shadow: 0 0 0 2px rgba(13, 143, 143, 0.15);
}

/* Scale (Likert 1-5 / 1-10) */
.scale-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 0;
}
.scale-options {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  overflow-x: auto;
  padding: 6px 2px;
}
.scale-chip {
  width: 48px;
  height: 48px;
  min-width: 48px;
  max-width: 48px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--border-color);
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.scale-chip:hover {
  border-color: var(--pmt-teal-500);
  background: var(--pmt-teal-50);
  color: var(--pmt-teal-700);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 10px rgba(13, 143, 143, 0.15);
}
.scale-chip.selected {
  background: linear-gradient(135deg, var(--pmt-teal-500), var(--pmt-teal-700));
  border-color: var(--pmt-teal-600);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(13, 143, 143, 0.35);
  transform: scale(1.12);
}
.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0 6px;
}

/* Error Message */
.error-feedback {
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--border-error);
  font-size: 0.825rem;
  font-weight: 500;
  margin-top: 10px;
  margin-left: 28px;
}
.card-error .error-feedback {
  display: flex;
}
@media (max-width: 600px) {
  .error-feedback {
    margin-left: 0;
  }
}

/* Submit Card */
.form-footer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: transparent;
  border: none;
  padding: 10px 0;
  box-shadow: none;
}

.btn-submit {
  background: linear-gradient(135deg, var(--pmt-teal-600), var(--pmt-teal-700));
  color: #ffffff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 14px 36px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(13, 143, 143, 0.25);
  transition: all 0.2s ease;
}

.btn-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--pmt-teal-700), var(--pmt-teal-800));
  box-shadow: 0 6px 18px rgba(13, 143, 143, 0.35);
  transform: translateY(-1px);
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-reset {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}
.btn-reset:hover {
  color: var(--text-main);
  text-decoration: underline;
}

/* Loading Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}
.btn-submit.loading .spinner {
  display: block;
}
.btn-submit.loading .btn-text {
  opacity: 0.9;
}

/* Success Card */
.form-success-card {
  display: none;
  text-align: center;
  padding: 48px 32px;
  border-top: 8px solid #10b981;
  animation: fadeIn 0.4s ease-out;
}
.success-icon-wrapper {
  width: 72px;
  height: 72px;
  background: #ecfdf5;
  color: #10b981;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 0 auto 20px auto;
  border: 2px solid #a7f3d0;
}
.success-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}
.success-message {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 28px auto;
}
.success-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: #f9fafb;
  border-color: #cbd5e1;
}

/* Modal Popup (Panduan Setup) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}
.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}
.modal-backdrop.active .modal-card {
  transform: translateY(0);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}
.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}
.btn-modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.guide-step {
  margin-bottom: 18px;
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px 16px;
  border-left: 4px solid var(--pmt-teal-600);
}
.guide-step-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 6px;
}
.guide-step p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.code-box {
  background: #1e293b;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.8rem;
  margin: 10px 0;
  overflow-x: auto;
  position: relative;
}
.btn-copy-code {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  float: right;
  margin-bottom: 6px;
}
.btn-copy-code:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
