/**
 * Product Request Form - Styles
 * 
 * LIVFRESH brand styling - Light theme.
 */

/* ============================================
   CSS VARIABLES - LIVFRESH BRAND
   ============================================ */

:root {
  /* Primary - Navy blue */
  --primary: #1a3a5c;
  --primary-dark: #0f2840;
  --primary-light: #2d5a87;
  
  /* Accent - Teal */
  --accent: #4ecdc4;
  --accent-dark: #3db5ad;
  --accent-light: #7ee8e1;
  
  /* Neutrals - Light theme */
  --bg-page: #f5f7fa;
  --bg-card: #ffffff;
  --bg-input: #f0f4f8;
  --text-primary: #1a3a5c;
  --text-secondary: #4a6785;
  --text-muted: #8099b3;
  --border: #d0dce8;
  --border-light: #e5ecf2;
  
  /* Status colors */
  --success: #22c55e;
  --error: #ef4444;
  
  /* Sizing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(26, 58, 92, 0.08);
  --shadow-md: 0 4px 20px rgba(26, 58, 92, 0.12);
  --shadow-lg: 0 8px 40px rgba(26, 58, 92, 0.15);
}

/* ============================================
   BASE STYLES
   ============================================ */

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px;
}

.hidden {
  display: none !important;
}

/* ============================================
   MAIN CARD
   ============================================ */

.main-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

/* ============================================
   FORM HEADER
   ============================================ */

.form-header {
  text-align: center;
  padding: 32px 24px 24px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--bg-input) 0%, var(--bg-card) 100%);
}

.form-header .logo-img {
  max-width: 200px;
  height: auto;
  margin-bottom: 20px;
}

.form-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.form-header .subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* ============================================
   OPTIONAL TAG & FIELD HINTS
   ============================================ */

.optional-tag {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8em;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* ============================================
   ACCESS CODE STATUS
   ============================================ */

.code-status {
  font-size: 0.8rem;
  margin-top: 6px;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.code-status.valid {
  color: #166534;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.code-status.neutral {
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-light);
}

.code-status.hidden {
  display: none;
}

/* ============================================
   VIP MULTI-SELECT CHECKBOX STYLE
   ============================================ */

.product-option .check-box {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.product-option .check-box.checked {
  border-color: var(--accent);
  background: var(--accent);
}

.product-option .check-box::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.product-option .check-box.checked::after {
  opacity: 1;
}

/* ============================================
   VIP QUANTITY CONTROLS
   ============================================ */

.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.qty-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(78, 205, 196, 0.08);
}

.qty-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 24px;
  text-align: center;
}

/* ============================================
   PRODUCT TAGS (Just Launched, Best Seller)
   ============================================ */

.product-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  margin-left: auto;
  white-space: nowrap;
}

/* ============================================
   RADIO GROUPS (Yes/No, shipping pref, etc.)
   ============================================ */

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-option:hover {
  border-color: var(--primary-light);
  background: var(--bg-card);
}

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

.radio-option .radio-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

.radio-group.invalid {
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--error);
  background: rgba(239, 68, 68, 0.03);
}

/* ============================================
   FORM CONTENT
   ============================================ */

.form-content {
  padding: 24px;
}

.form-section {
  margin-bottom: 28px;
}

.section-label {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.section-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ============================================
   PRODUCT OPTIONS
   ============================================ */

.product-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-option:hover {
  border-color: var(--primary-light);
  background: var(--bg-card);
}

.product-option.selected {
  border-color: var(--accent);
  background: rgba(78, 205, 196, 0.08);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
}

.product-option .radio-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.product-option.selected .radio-circle {
  border-color: var(--accent);
  background: var(--accent);
}

.product-option .radio-circle::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.product-option.selected .radio-circle::after {
  opacity: 1;
}

.product-option .product-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================
   FORM GROUPS
   ============================================ */

.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-group .required {
  color: var(--error);
}

.form-group input:not([type="radio"]):not([type="checkbox"]),
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.form-group input:not([type="radio"]):not([type="checkbox"]):focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group select {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a6785' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

.form-group select.invalid {
  border-color: var(--error);
  background-color: rgba(239, 68, 68, 0.03);
}

#position-other {
  margin-top: 10px;
}

#position-other.hidden {
  display: none;
}

/* ============================================
   CONSENT CHECKBOX
   ============================================ */

.consent-section {
  margin-bottom: 0;
}

.consent-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}

.consent-checkbox:hover {
  border-color: var(--border);
}

.consent-checkbox input[type="checkbox"] {
  display: none;
}

.consent-checkbox .checkmark {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-top: 2px;
}

.consent-checkbox input[type="checkbox"]:checked + .checkmark {
  background: var(--accent);
  border-color: var(--accent);
}

.consent-checkbox .checkmark::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.consent-checkbox input[type="checkbox"]:checked + .checkmark::after {
  opacity: 1;
}

.consent-checkbox .consent-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================
   CAPTCHA SECTION
   ============================================ */

.captcha-section {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.captcha-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================
   FORM ACTIONS
   ============================================ */

.form-actions {
  margin-top: 24px;
}

.submit-button {
  width: 100%;
  padding: 16px 24px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.submit-button:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

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

.btn-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   SPINNER
   ============================================ */

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.small {
  width: 18px;
  height: 18px;
  border-width: 2px;
  border-color: rgba(255,255,255,0.3);
  border-top-color: white;
}

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

/* ============================================
   SUCCESS STATE
   ============================================ */

.success-state {
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  color: var(--success);
  margin-bottom: 20px;
}

.success-icon.verify-icon {
  color: var(--accent);
}

.success-state h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.success-state p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.success-state .subtext {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ============================================
   ERROR STATE
   ============================================ */

.error-state {
  text-align: center;
  padding: 24px 20px;
  background: rgba(239, 68, 68, 0.05);
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.2);
  margin-bottom: 20px;
}

.error-icon {
  color: var(--error);
  margin-bottom: 12px;
}

.error-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.error-state p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.retry-button {
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--error);
  background: white;
  border: 2px solid var(--error);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.retry-button:hover {
  background: var(--error);
  color: white;
}

/* ============================================
   FORM FOOTER
   ============================================ */

.form-footer {
  text-align: center;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-input);
}

.form-footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-footer a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 500;
}

.form-footer a:hover {
  text-decoration: underline;
}

/* ============================================
   VALIDATION STATES
   ============================================ */

.form-group input:not([type="radio"]):not([type="checkbox"]).invalid,
.form-group textarea.invalid {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.03);
}

.form-group input:not([type="radio"]):not([type="checkbox"]).invalid:focus,
.form-group textarea.invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.product-options.invalid {
  padding: 8px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--error);
  background: rgba(239, 68, 68, 0.03);
}

/* ============================================
   FORM ROW (City / State / ZIP)
   ============================================ */

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  margin-bottom: 16px;
}

.form-group--city {
  flex: 2;
}

.form-group--state {
  flex: 1.5;
}

.form-group--zip {
  flex: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
  .container {
    padding: 12px;
  }
  
  .form-header {
    padding: 24px 16px 20px;
  }
  
  .form-header h1 {
    font-size: 1.4rem;
  }
  
  .form-content {
    padding: 20px 16px;
  }
  
  .form-header .logo-img {
    max-width: 160px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
}
