/**
 * Financial Journey Quick Start Form
 * Mobile-first responsive design
 */

/* ============================================
   MOBILE FIRST - Base Styles
   ============================================ */

.fj-quick-start {
  max-width: 100%;
  margin: 0 auto;
  padding: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.fj-form-container {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.fj-form-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.fj-form-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.fj-form-subtitle {
  font-size: 0.875rem;
  color: var(--text-color);
  opacity: 0.7;
  margin-bottom: 0;
}

/* Form Sections */
.fj-form-section {
  margin-bottom: 2rem;
}

.fj-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

.fj-section-icon {
  font-size: 1.25rem;
  color: var(--primary-color);
}

.fj-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Form Groups */
.fj-form-group {
  margin-bottom: 1.25rem;
}

.fj-form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.fj-form-label-optional {
  color: var(--text-color);
  opacity: 0.6;
  font-weight: 400;
  font-size: 0.75rem;
}

.fj-form-input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.2s ease;
  background-color: var(--input-bg);
  color: var(--text-color);
}

.fj-form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(10, 124, 255, 0.15);
}

/* Error State */
.fj-form-input.error {
  border-color: #dc3545;
  background-color: rgba(220, 53, 69, 0.05);
}

.fj-form-input.error:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.fj-error-message {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.fj-error-message::before {
  content: "⚠️";
  font-size: 0.75rem;
}

.fj-input-with-prefix {
  position: relative;
}

.fj-input-prefix {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-color);
  opacity: 0.6;
  font-size: 1rem;
  font-weight: 500;
  pointer-events: none;
}

.fj-input-with-prefix .fj-form-input {
  padding-left: 2rem;
}

/* Radio Buttons - Mobile Optimized */
.fj-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fj-radio-option {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: var(--card-bg);
  color: var(--text-color);
}

.fj-radio-option:active {
  transform: scale(0.98);
}

.fj-radio-option input[type="radio"] {
  margin-right: 0.75rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.fj-radio-option.selected {
  border-color: var(--primary-color);
  background-color: rgba(10, 124, 255, 0.08);
}

/* Checkbox */
.fj-checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: var(--card-bg);
  color: var(--text-color);
}

.fj-checkbox-wrapper input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.fj-checkbox-wrapper.checked {
  border-color: var(--primary-color);
  background-color: rgba(10, 124, 255, 0.08);
}

.fj-checkbox-content {
  flex: 1;
}

.fj-checkbox-label {
  font-weight: 500;
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

/* Inline Checkbox (for preferences) */
.fj-checkbox-label.inline {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--card-bg);
  transition: all 0.2s ease;
}

.fj-checkbox-label.inline:hover {
  border-color: var(--primary-color);
  background-color: rgba(10, 124, 255, 0.05);
}

.fj-checkbox {
  margin-top: 0.25rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.fj-checkbox-text {
  flex: 1;
  font-weight: 500;
  color: var(--text-color);
}

/* Dependents List */
.fj-dependents-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.fj-dependent-item {
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--card-bg);
}

.fj-dependent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.fj-dependent-title {
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.875rem;
}

.fj-dependent-remove {
  background: none;
  border: none;
  color: #dc3545;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.fj-dependent-remove:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

.fj-dependent-fields {
  display: grid;
  gap: 0.75rem;
}

/* Add Button */
.fj-add-button {
  width: 100%;
  padding: 0.75rem;
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  background: transparent;
  color: var(--primary-color);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.fj-add-button:hover {
  border-color: var(--primary-color);
  background-color: rgba(10, 124, 255, 0.08);
}

.fj-add-button:active {
  transform: scale(0.98);
}

/* Conditional Fields */
.fj-conditional-field {
  margin-top: 1rem;
  padding: 1rem;
  background-color: rgba(10, 124, 255, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

/* Submit Button */
.fj-submit-button {
  width: 100%;
  padding: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.fj-submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.fj-submit-button:active {
  transform: translateY(0);
}

.fj-submit-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Footer Note */
.fj-form-footer {
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.fj-footer-text {
  font-size: 0.75rem;
  color: var(--text-color);
  opacity: 0.6;
  margin: 0;
}

/* Loading State */
.fj-form-container.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ============================================
   TABLET - 768px and up
   ============================================ */
@media (min-width: 768px) {
  .fj-quick-start {
    padding: 2rem;
  }

  .fj-form-container {
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
  }

  .fj-form-title {
    font-size: 2rem;
  }

  .fj-form-subtitle {
    font-size: 1rem;
  }

  .fj-section-title {
    font-size: 1.125rem;
  }

  /* Radio buttons in row on tablet */
  .fj-radio-group {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .fj-radio-option {
    flex: 1;
    min-width: 150px;
  }

  /* Two columns for dependent fields */
  .fj-dependent-fields {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================
   DESKTOP - 1024px and up
   ============================================ */
@media (min-width: 1024px) {
  .fj-form-container {
    max-width: 700px;
    padding: 2.5rem;
  }

  .fj-form-title {
    font-size: 2.25rem;
  }

  /* Hover effects for desktop */
  .fj-radio-option:hover {
    border-color: var(--primary-color);
    background-color: rgba(10, 124, 255, 0.05);
  }

  .fj-checkbox-wrapper:hover {
    border-color: var(--primary-color);
    background-color: rgba(10, 124, 255, 0.05);
  }

  .fj-form-input:hover {
    border-color: var(--primary-color);
    opacity: 0.8;
  }
}

/* ============================================
   THEME SUPPORT
   ============================================ */

/*
  Theme colors automatically adapt via CSS custom properties:
  - var(--bg-color): Page background
  - var(--text-color): Main text
  - var(--card-bg): Card/container backgrounds
  - var(--border-color): Borders
  - var(--input-bg): Form input backgrounds
  - var(--primary-color): Primary actions/accents

  No explicit [data-theme] rules needed - variables handle everything!
*/

/* Custom select dropdown arrow styling */
select.fj-form-input {
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
  appearance: none;
}

/* Dark theme: lighter arrow */
[data-theme="dark"] select.fj-form-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23aaa' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

/* Light theme: darker arrow */
[data-theme="light"] select.fj-form-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23212529' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

/* ============================================
   USER PROFILE PRESETS
   ============================================ */

.fj-profile-presets {
  background: var(--input-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  overflow: hidden;
  max-width: 100%;
}

.fj-profile-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.fj-profile-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.fj-profile-subtitle {
  font-size: 0.875rem;
  color: var(--text-color);
  opacity: 0.7;
  margin: 0;
}

.fj-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  width: 100%;
}

.fj-profile-loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-color);
  opacity: 0.6;
}

.fj-profile-button {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  width: 100%;
  min-height: 120px;
}

.fj-profile-button:hover {
  border-color: var(--primary-color);
  background: var(--input-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 124, 255, 0.15);
}

.fj-profile-button:active {
  transform: translateY(0);
}

.fj-profile-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #0062cc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transition: transform 0.2s ease;
}

.fj-profile-button:hover .fj-profile-icon {
  transform: scale(1.1);
}

.fj-profile-content {
  width: 100%;
}

.fj-profile-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.fj-profile-desc {
  font-size: 0.7rem;
  color: var(--text-color);
  opacity: 0.7;
  margin: 0;
  line-height: 1.3;
}

.fj-profile-footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.fj-clear-form-btn {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-color);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.fj-clear-form-btn:hover {
  border-color: #dc3545;
  color: #dc3545;
  background: rgba(220, 53, 69, 0.05);
}

.fj-clear-form-btn:active {
  transform: scale(0.98);
}

/* Toast notification for profile loaded */
.fj-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #28a745;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(1rem);
  transition: all 0.3s ease;
  z-index: 10000;
}

.fj-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .fj-profile-grid {
    gap: 1rem;
  }
}

/* ============================================
   NOTIFICATION BANNERS
   ============================================ */

/**
 * Base notification banner styles
 */
.fj-notification {
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: opacity 0.3s ease-out;
}

/**
 * Notification icon
 */
.fj-notification-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/**
 * Notification content area
 */
.fj-notification-content {
  flex: 1;
}

/**
 * Notification title
 */
.fj-notification-title {
  font-weight: 600;
  margin: 0;
  color: var(--text-color);
}

/**
 * Notification message
 */
.fj-notification-message {
  margin: 0.25rem 0 0 0;
  font-size: 0.875rem;
  opacity: 0.8;
  color: var(--text-color);
}

/**
 * Notification close button
 */
.fj-notification-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.fj-notification-close:hover {
  opacity: 0.7;
}

/**
 * Success notification variant (green)
 */
.fj-notification--success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid #10b981;
}

.fj-notification--success .fj-notification-icon,
.fj-notification--success .fj-notification-close {
  color: #10b981;
}

/**
 * Info notification variant (blue)
 */
.fj-notification--info {
  background: rgba(10, 124, 255, 0.1);
  border: 1px solid #0a7cff;
}

.fj-notification--info .fj-notification-icon,
.fj-notification--info .fj-notification-close {
  color: #0a7cff;
}

/**
 * Home notification variant (green, for home planner)
 */
.fj-notification--home {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid #10b981;
}

.fj-notification--home .fj-notification-icon,
.fj-notification--home .fj-notification-close {
  color: #10b981;
}

/* ============================================
   INFO BOX COMPONENT (Theme-Adaptive)
   ============================================ */

/**
 * Info box for highlighting important notices
 * Adapts colors for both dark and light themes
 */

/* Dark theme (default) */
.fj-info-box {
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid #3b82f6;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.fj-info-box-inner {
  display: flex;
  align-items: start;
  gap: 0.75rem;
}

.fj-info-box-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.fj-info-box-content {
  flex: 1;
}

.fj-info-box-heading {
  font-weight: 600;
  color: #60a5fa;
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
}

.fj-info-box-text {
  color: #93c5fd;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.fj-info-box-text strong {
  color: #bfdbfe;
  font-weight: 600;
}

/* Light theme overrides */
[data-theme="light"] .fj-info-box {
  background: linear-gradient(135deg, #EBF8FF 0%, #E0F2FE 100%);
  border-left: 4px solid #0EA5E9;
}

[data-theme="light"] .fj-info-box-heading {
  color: #0369A1;
}

[data-theme="light"] .fj-info-box-text {
  color: #075985;
}

[data-theme="light"] .fj-info-box-text strong {
  color: #0c4a6e;
}

/* Advanced Settings Accordion */
.fj-advanced-settings {
  border: 2px dashed rgba(var(--primary-color-rgb), 0.3);
  background: rgba(var(--primary-color-rgb), 0.02);
}

.fj-accordion-header {
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  margin-bottom: 0;
  transition: background-color 0.2s ease;
}

.fj-accordion-header:hover {
  background: rgba(var(--primary-color-rgb), 0.05);
}

.fj-accordion-toggle {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fj-accordion-toggle[aria-expanded="true"] {
  transform: rotate(180deg);
}

.fj-optional-badge {
  font-size: 0.75rem;
  color: var(--primary-color);
  background: rgba(var(--primary-color-rgb), 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 500;
}

.fj-accordion-content {
  padding: 0 1.5rem 1.5rem 1.5rem;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 2000px;
  }
}

.fj-section-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.fj-subsection {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(var(--primary-color-rgb), 0.1);
}

.fj-subsection:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.fj-subsection-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

@media (max-width: 768px) {
  .fj-form-row {
    grid-template-columns: 1fr;
  }
}

.fj-form-label-default {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.85rem;
}
