/**
 * Fatiha Marriage Registration Form Styles
 *
 * Sections:
 * 0. CSS Variables (whitelabel support)
 * 1. Flatpickr customization
 * 2. Base / Reset
 * 3. Layout
 * 4. Typography
 * 5. Form elements
 * 6. Pill buttons (radio/checkbox)
 * 7. States (loading, error, success)
 * 8. Profile header (edit mode)
 * 9. Validation errors
 * 10. Responsive
 */

/* =============================================================================
   0. CSS VARIABLES (Whitelabel Support)
   ============================================================================= */

:root {
  --primary-color: #5a4a8e;
  --primary-hover: #6a5a9e;
  --primary-active: #4a3a7e;
  --accent-color: #3d2a7f;
  --light-bg: #f8f7fc;
  --light-hover: #f0eef5;
  --border-accent: #e0d4f7;
}

/* =============================================================================
   1. FLATPICKR CUSTOMIZATION
   ============================================================================= */

.flatpickr-calendar {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.flatpickr-months {
  background: var(--primary-color);
}

.flatpickr-months .flatpickr-month {
  background: var(--primary-color);
  color: white;
  height: 44px;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  padding: 10px;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
  fill: white;
  width: 14px;
  height: 14px;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: rgba(255,255,255,0.7);
}

.flatpickr-current-month {
  padding-top: 6px;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  background: var(--primary-color);
  color: white;
  font-weight: 500;
}

.flatpickr-current-month input.cur-year {
  color: white;
  font-weight: 600;
}

.flatpickr-current-month .numInputWrapper span.arrowUp:after {
  border-bottom-color: white;
}

.flatpickr-current-month .numInputWrapper span.arrowDown:after {
  border-top-color: white;
}

.flatpickr-weekdays {
  background: var(--primary-color);
  padding: 8px 0;
}

.flatpickr-weekday {
  background: var(--primary-color) !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 13px;
}

.flatpickr-day {
  border-radius: 8px;
}

.flatpickr-day:hover {
  background: var(--light-hover);
  border-color: var(--light-hover);
}

.flatpickr-day.selected {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.flatpickr-day.selected:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.flatpickr-day.today {
  border-color: var(--primary-color);
}

/* =============================================================================
   2. BASE / RESET
   ============================================================================= */

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

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #ffffff;
  color: #1a1a2e;
  line-height: 1.6;
}

/* =============================================================================
   3. LAYOUT
   ============================================================================= */

.form-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* =============================================================================
   4. TYPOGRAPHY
   ============================================================================= */

/* Header */
.header {
  text-align: center;
  margin-bottom: 48px;
}

.header-logo {
  width: 260px;
  height: auto;
  margin: 0 auto 24px;
}

.header-logo > img {
  width: 100%;
  height: auto;
}

.header-logo > img.whitelabel-logo {
  width: auto;
  max-height: 120px;
}

.partnership-text {
  font-size: 0.55rem;
  color: #bbb;
  margin-top: 4px;
}

.partnership-text img {
  height: 10px;
  width: auto;
  vertical-align: middle;
  margin-left: 2px;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1a1a2e;
}

.header p {
  font-size: 1rem;
  color: #666;
}

/* =============================================================================
   5. FORM ELEMENTS
   ============================================================================= */

/* Form sections */
.form-section {
  margin-bottom: 80px;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-color);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0dce8;
}

/* Question blocks */
.question {
  margin-bottom: 28px;
}

.question:last-child {
  margin-bottom: 0;
}

.question label {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: #1a1a2e;
}

.question .hint {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 12px;
}

/* Text inputs */
.text-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.text-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 3px rgba(61, 42, 127, 0.1);
}

.text-input::placeholder {
  color: #aaa;
}

/* Textarea */
textarea.text-input {
  min-height: 120px;
  resize: vertical;
}

/* Number input */
input[type="number"].text-input {
  -moz-appearance: textfield;
}

input[type="number"].text-input::-webkit-outer-spin-button,
input[type="number"].text-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Consent text */
.consent-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #555;
}

.consent-text a {
  color: var(--primary-color);
  text-decoration: underline;
}

.consent-text a:hover {
  color: var(--accent-color);
}

/* WhatsApp consent subtext */
.consent-subtext {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #666;
  margin-top: 8px;
}

.whatsapp-consent-section {
  margin-top: 25px;
  margin-bottom: 24px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

/* Required asterisk */
.required::after {
  content: ' *';
  color: #e74c3c;
}

/* =============================================================================
   6. PILL BUTTONS (Radio/Checkbox)
   ============================================================================= */

/* Single select pills */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-option {
  position: relative;
}

.pill-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pill-option label {
  display: inline-block;
  padding: 12px 24px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #444;
  transition: all 0.2s;
  margin-bottom: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pill-option input:checked + label {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  box-shadow: 0 1px 3px rgba(90, 74, 158, 0.3);
}

.pill-option label:hover {
  border-color: var(--accent-color);
  background: var(--light-bg);
}

.pill-option input:checked + label:hover {
  background: var(--primary-hover);
}

.pill-option input:focus + label {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Multi-select checkbox pills */
.checkbox-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-pill {
  position: relative;
}

.checkbox-pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-pill label {
  display: inline-block;
  padding: 12px 24px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #444;
  transition: all 0.2s;
  margin-bottom: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.checkbox-pill input:checked + label {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  box-shadow: 0 1px 3px rgba(90, 74, 158, 0.3);
}

.checkbox-pill label:hover {
  border-color: var(--accent-color);
  background: var(--light-bg);
}

.checkbox-pill input:checked + label:hover {
  background: var(--primary-hover);
}

.checkbox-pill input:focus + label {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* =============================================================================
   7. STATES (Loading, Error, Success)
   ============================================================================= */

.loading-state,
.error-state,
.success-state {
  text-align: center;
  padding: 60px 20px;
}

.spinner-large {
  width: 48px;
  height: 48px;
  border: 4px solid var(--light-bg);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

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

.error-state {
  background: #fdf2f2;
  border-radius: 12px;
  border: 1px solid #f5c6c6;
}

.error-state h2 {
  color: #c44536;
  margin-bottom: 12px;
}

.success-state {
  background: var(--light-bg);
  border-radius: 12px;
  border: 1px solid var(--border-accent);
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--accent-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
}

.success-state h2 {
  color: var(--accent-color);
  margin-bottom: 12px;
}

/* Full success page (register) */
.success-page {
  padding: 20px 0;
}

.success-heading {
  font-size: 1.75rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 12px;
  text-align: center;
}

.success-subtitle {
  font-size: 1rem;
  color: #666;
  margin-bottom: 0;
  text-align: center;
}

.divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 32px 0;
}

.success-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 16px;
}

.success-section p {
  color: #555;
  line-height: 1.7;
  margin-bottom: 8px;
}

.success-section a {
  color: var(--primary-color);
  text-decoration: underline;
}

.success-section a:hover {
  color: var(--accent-color);
}

.hint-text {
  color: #888 !important;
  font-size: 0.9rem;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #555;
  line-height: 1.5;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background: var(--primary-color);
  color: white;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.app-store-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.app-store-btn img {
  height: 40px;
  width: auto;
}

.app-store-btn.coming-soon {
  opacity: 0.5;
  cursor: default;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #555 !important;
  text-decoration: none !important;
  font-size: 0.95rem;
}

.contact-link:hover {
  color: var(--accent-color) !important;
}

.quran-verse {
  text-align: center;
  padding: 20px 0;
}

.quran-verse .arabic {
  font-size: 1.5rem;
  line-height: 2;
  color: #333;
  margin-bottom: 16px;
}

.quran-verse .translation {
  font-style: italic;
  color: #555;
  margin-bottom: 8px;
}

.quran-verse .reference {
  color: #888;
  font-size: 0.9rem;
}

/* Success message */
.success-message {
  text-align: center;
  padding: 60px 20px;
}

.success-message .icon {
  width: 80px;
  height: 80px;
  background: #e8f5e9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 40px;
}

.success-message h2 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 12px;
}

.success-message p {
  color: #666;
  font-size: 1rem;
}

/* =============================================================================
   8. PROFILE HEADER (Edit Mode)
   ============================================================================= */

.profile-header {
  background: var(--light-bg);
  border-left: 4px solid var(--accent-color);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-ref {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-color);
}

.profile-name {
  color: #666;
  font-size: 1rem;
}

.priority-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.priority-credits {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 500;
}

.priority-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 6px rgba(90, 74, 142, 0.25);
}

.priority-btn:hover {
  background: var(--primary-hover);
}

.priority-btn:disabled {
  background: #9a8fc4;
  cursor: not-allowed;
}

.priority-btn.requested {
  background: #4ade80;
  cursor: default;
}

.priority-btn.requested:hover {
  background: #4ade80;
}

/* =============================================================================
   9. VALIDATION ERRORS
   ============================================================================= */

/* Inline submission error banner */
.submit-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.submit-error-title {
  color: #dc2626;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.submit-error-title::before {
  content: '!';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #dc2626;
  color: white;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
}

.submit-error-message {
  color: #991b1b;
  font-size: 0.9rem;
  margin-left: 28px;
}

/* Field-level errors */
.field-error {
  font-size: 0.85rem;
  color: #c0392b;
  margin-top: 8px;
  display: none;
  padding: 10px 14px;
  background: #fdf2f2;
  border-radius: 6px;
  border-left: 3px solid #e74c3c;
}

.text-input.input-error {
  border-color: #e57373;
  background: #fffafa;
}

.text-input.input-error:focus {
  border-color: #e57373;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Question-level error state */
.question.has-error label:first-of-type::after {
  content: ' - Required';
  color: #c0392b;
  font-weight: 400;
  font-size: 0.85rem;
}

.question.has-error .pill-option label::after,
.question.has-error .checkbox-pill label::after {
  content: none;
}

.question.has-error .pill-group,
.question.has-error .checkbox-pills {
  padding: 8px;
  background: #fdf2f2;
  border-radius: 8px;
  margin: -8px -8px 8px -8px;
}

/* Show field error when parent has error class (CSS fallback for x-show) */
.question.has-error .field-error {
  display: block;
}

/* =============================================================================
   10. SUBMIT BUTTON
   ============================================================================= */

.submit-section {
  padding: 0;
  text-align: left;
}

/* Reduce spacing at end of form */
.form-section:nth-last-of-type(1),
.form-section:nth-last-of-type(2),
.form-section:nth-last-of-type(3) {
  margin-bottom: 24px;
}

.submit-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 16px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(61, 42, 127, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.submit-btn .arrow {
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.submit-btn:hover .arrow {
  transform: translateX(3px);
}

.submit-btn:hover {
  background: var(--primary-color);
  box-shadow: 0 2px 6px rgba(61, 42, 127, 0.4);
}

.submit-btn:active {
  transform: scale(0.98);
}

.submit-btn:disabled {
  background: #9a8fc4;
  cursor: not-allowed;
  transform: none;
}

.submit-btn .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

/* =============================================================================
   11. PREFIXED INPUT
   ============================================================================= */

.input-with-prefix {
  display: inline-flex;
  align-items: stretch;
}

.input-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--light-bg);
  border: 1px solid #e0e0e0;
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-weight: 500;
  color: var(--primary-color);
}

.input-with-prefix .text-input {
  border-radius: 0 8px 8px 0;
  width: 100px;
  margin: 0;
}

/* =============================================================================
   12. UTILITIES
   ============================================================================= */

.hidden {
  display: none !important;
}

/* Footer */
.footer {
  padding: 48px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: #999;
}

/* Info box - dashed border style for conditional messages */
.info-box {
  color: var(--primary-color);
  font-size: 0.95rem;
  margin: 0;
  padding: 14px 20px;
  background: var(--light-bg);
  border-radius: 8px;
  border: 1px dashed var(--border-accent);
}

/* Loading text */
.loading-text {
  padding: 12px;
  color: #666;
}

/* Secondary link style */
.secondary-link {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #666;
}

.secondary-link a {
  color: var(--primary-color);
}

/* =============================================================================
   12. RESPONSIVE
   ============================================================================= */

@media (max-width: 640px) {
  .form-section {
    padding: 24px 20px;
  }

  .header {
    padding: 32px 20px;
  }

  .submit-section {
    padding: 24px 20px 0;
  }

  .pill-option label,
  .checkbox-pill label {
    padding: 10px 18px;
    font-size: 0.9rem;
  }
}

/* =============================================================================
   13. TOM SELECT (Community Dropdown)
   ============================================================================= */

.ts-wrapper {
  width: 100%;
  border: none !important;
  box-shadow: none !important;
  background: none !important;
}

.ts-wrapper.single .ts-control {
  padding: 14px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  min-height: auto;
  cursor: pointer;
}

.ts-wrapper.single .ts-control::after {
  /* Dropdown arrow */
  border-color: #666 transparent transparent transparent;
}

.ts-wrapper.single .ts-control:hover {
  border-color: #ccc;
}

.ts-wrapper.single.focus .ts-control {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 3px rgba(61, 42, 127, 0.1);
}

.ts-wrapper.single .ts-control input {
  font-size: 1rem;
}

.ts-wrapper.single .ts-control input::placeholder {
  color: #aaa;
}

/* Remove any default borders/backgrounds on wrapper */
.ts-wrapper.single {
  border: none;
  padding: 0;
  margin: 0;
}

.ts-wrapper .ts-dropdown {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-top: 4px;
}

.ts-wrapper .ts-dropdown .optgroup-header {
  font-weight: 600;
  padding: 10px 14px;
  background: var(--light-bg);
  color: var(--accent-color);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ts-wrapper .ts-dropdown .option {
  padding: 12px 14px;
  display: flex;
  align-items: center;
}

.ts-wrapper .ts-dropdown .option .city {
  color: #888;
  font-size: 0.85em;
  margin-left: auto;
}

.ts-wrapper .ts-dropdown .option.active {
  background: var(--light-bg);
  color: var(--accent-color);
}

.ts-wrapper .ts-dropdown .option:hover {
  background: var(--light-bg);
}

.ts-wrapper .ts-control .item {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 1rem;
  color: #333;
}

/* =============================================================================
   COMMUNITY SEARCH AUTOCOMPLETE
   ============================================================================= */

.community-search-container {
  position: relative;
}

.community-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 4px;
}

.community-suggestion-item {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}

.community-suggestion-item:last-child {
  border-bottom: none;
}

.community-suggestion-item:hover {
  background: var(--light-bg);
}

.community-suggestion-item .name {
  font-weight: 500;
  color: #333;
}

.community-suggestion-item .details {
  font-size: 0.85rem;
  color: #888;
  margin-top: 2px;
}

.community-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 18px;
  padding: 4px;
  line-height: 1;
}

.community-clear-btn:hover {
  color: #666;
}

.selected-community {
  margin-top: 8px;
  padding: 12px;
  background: var(--light-bg);
  border-radius: 8px;
  border: 1px solid var(--border-accent);
}

.selected-community .label {
  color: var(--accent-color);
}

.no-results-message {
  padding: 12px 14px;
  color: #888;
  font-size: 0.9rem;
}

.loading-spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid #e0e0e0;
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* =============================================================================
   LOGIN / EMAIL VERIFICATION (copied from fatiha-dashboard)
   ============================================================================= */

/* Login Container */
.login-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--light-bg) 0%, #fff 100%);
  z-index: 100;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(90, 74, 158, 0.1);
  padding: 40px 32px;
}

.login-logo {
  text-align: center;
  margin-bottom: 20px;
}

.login-logo img {
  height: 120px;
  width: auto;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 8px 0;
  text-align: center;
}

.login-subtitle {
  font-size: 0.95rem;
  color: #666;
  margin: 0 0 24px 0;
  text-align: center;
}

/* Login Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #333;
}

.login-field input {
  padding: 12px 16px;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-field input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(90, 74, 158, 0.1);
}

.login-field input:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary-color);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.login-btn:hover:not(:disabled) {
  background: var(--primary-active);
}

.login-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Login Error */
.login-error {
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* Login Footer */
.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: #666;
}

.login-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

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

/* Login Success State */
.login-success {
  text-align: center;
  padding: 20px 0;
}

.login-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: #dcfce7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #16a34a;
}

.login-success h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 12px 0;
}

.login-success p {
  color: #666;
  margin: 0;
  font-size: 0.95rem;
}

.login-success-email {
  font-weight: 600;
  color: #333;
  margin-top: 4px !important;
}

.login-success-hint {
  margin-top: 16px !important;
  font-size: 0.85rem !important;
  color: #999 !important;
}

.login-retry-btn {
  margin-top: 24px;
  padding: 10px 20px;
  font-size: 0.9rem;
  color: var(--primary-color);
  background: transparent;
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.login-retry-btn:hover {
  background: var(--light-bg);
}

/* OTP Code Input */
.code-input-section {
  margin: 24px 0 8px;
}

.code-divider {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.code-divider::before,
.code-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0dce8;
}

.code-divider span {
  padding: 0 16px;
  font-size: 0.85rem;
  color: #666;
}

.code-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.code-input {
  width: 100%;
  padding: 16px;
  font-size: 1.5rem;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  letter-spacing: 8px;
  text-align: center;
  border: 2px solid #e0dce8;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.code-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(90, 74, 158, 0.1);
}

.code-input:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

.code-input::placeholder {
  color: #ccc;
  letter-spacing: 8px;
}

.code-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--primary-color);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.code-btn:hover:not(:disabled) {
  background: var(--primary-hover);
}

.code-btn:disabled {
  background: #9a8fc4;
  cursor: not-allowed;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

/* Mobile */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
  }

  .login-logo img {
    height: 100px;
  }
}

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

.site-footer {
  padding: 40px 24px;
  text-align: center;
  border-top: 1px solid #eee;
  margin-top: 40px;
  background: #fafafa;
}

.site-footer p {
  font-size: 0.85rem;
  color: #888;
  margin: 0;
}

.app-coming-soon {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.app-badges {
  display: flex;
  gap: 12px;
  opacity: 0.35;
}

.app-badges img {
  height: 36px;
}

.app-coming-soon span {
  font-size: 0.75rem;
  color: #999;
}
