/* ============================================== */
/* SPENDFLOW MODAL FORM - REUSABLE COMPONENT     */
/* This file contains all styles for the demo   */
/* scheduling modal that appears across the site */
/* ============================================== */

/* Modal Overlay - The dark background that appears behind the modal */
.sf-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* When modal is active, show it with fade-in effect */
.sf-modal-overlay.active {
  display: flex;
  opacity: 1;
}

/* Modal Container - The white box that contains the form */
.sf-modal {
  background: linear-gradient(180deg, #1A1A1A 0%, #0D0D0D 100%);
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animate modal when it becomes active */
.sf-modal-overlay.active .sf-modal {
  transform: scale(1) translateY(0);
}

/* Modal Content - Inner padding for the form */
.sf-modal-content {
  padding: 32px;
}

/* Close Button - X button in top right corner */
.sf-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.sf-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.sf-modal-close svg {
  width: 16px;
  height: 16px;
  stroke: #999;
  transition: stroke 0.2s ease;
}

.sf-modal-close:hover svg {
  stroke: #fff;
}

/* Header Section - Title and subtitle */
.sf-modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.sf-modal-logo {
  display: none;
}

.sf-modal-title {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.sf-modal-subtitle {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: #888;
  margin: 0;
  line-height: 1.5;
}

/* Form Styles */
.sf-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sf-form-group {
  position: relative;
}

/* Input Fields */
.sf-form-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.sf-form-input::placeholder {
  color: #666;
}

/* When user focuses on input, highlight with green border */
.sf-form-input:focus {
  border-color: #1ED891;
  background: rgba(30, 216, 145, 0.03);
  box-shadow: 0 0 0 3px rgba(30, 216, 145, 0.1);
}

/* Error state - red border when validation fails */
.sf-form-input.error {
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.03);
}

.sf-form-input.error:focus {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Error Messages */
.sf-field-error {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  color: #EF4444;
  margin-top: 6px;
  display: none;
  align-items: center;
  gap: 4px;
}

.sf-field-error.visible {
  display: flex;
}

.sf-field-error svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Textarea for additional needs */
.sf-form-textarea {
  min-height: 80px;
  resize: vertical;
}

/* Submit Button */
.sf-form-submit {
  width: 100%;
  padding: 16px 24px;
  margin-top: 4px;
  background: linear-gradient(135deg, #1ED891 0%, #15B577 100%);
  border: none;
  border-radius: 12px;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #000000;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(30, 216, 145, 0.3);
}

.sf-form-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(30, 216, 145, 0.4);
}

.sf-form-submit:active:not(:disabled) {
  transform: translateY(0);
}

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

/* Loading Spinner - Shows when form is being submitted */
.sf-form-submit .sf-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: #000;
  border-radius: 50%;
  animation: sf-spin 0.8s linear infinite;
  display: none;
}

.sf-form-submit.loading .sf-spinner {
  display: block;
}

.sf-form-submit.loading .sf-btn-text {
  display: none;
}

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

/* Success/Error Messages */
.sf-form-message {
  padding: 14px 18px;
  border-radius: 12px;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  text-align: center;
  display: none;
  margin-top: 12px;
}

.sf-form-message.success {
  display: block;
  background: rgba(30, 216, 145, 0.1);
  border: 1px solid rgba(30, 216, 145, 0.3);
  color: #1ED891;
}

.sf-form-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #EF4444;
}

/* Success Overlay - Full screen animation after successful submission */
.sf-success-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #1A1A1A 0%, #0D0D0D 100%);
  border-radius: 24px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  box-sizing: border-box;
  z-index: 20;
}

.sf-success-overlay.active {
  display: flex;
  animation: sf-fade-in 0.4s ease;
}

@keyframes sf-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Success Checkmark Animation */
.sf-success-checkmark {
  width: 100px;
  height: 100px;
  margin-bottom: 24px;
}

.sf-checkmark-circle {
  stroke: #1ED891;
  stroke-width: 2;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  fill: none;
  animation: sf-circle-draw 0.6s ease forwards;
}

.sf-checkmark-check {
  stroke: #1ED891;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: sf-check-draw 0.4s ease 0.4s forwards;
}

@keyframes sf-circle-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes sf-check-draw {
  to { stroke-dashoffset: 0; }
}

.sf-success-title {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 12px 0;
  text-align: center;
  opacity: 0;
  animation: sf-slide-up 0.5s ease 0.5s forwards;
}

.sf-success-message {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  color: #888;
  margin: 0 0 32px 0;
  text-align: center;
  line-height: 1.6;
  opacity: 0;
  animation: sf-slide-up 0.5s ease 0.6s forwards;
}

.sf-success-close-btn {
  padding: 14px 32px;
  background: linear-gradient(135deg, #1ED891 0%, #15B577 100%);
  border: none;
  border-radius: 12px;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #000000;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(30, 216, 145, 0.3);
  opacity: 0;
  animation: sf-slide-up 0.5s ease 0.7s forwards;
}

.sf-success-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(30, 216, 145, 0.4);
}

@keyframes sf-slide-up {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Phone Input Hint */
.sf-input-hint {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  color: #555;
  margin-top: 4px;
}

/* Privacy Note */
.sf-privacy-note {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  color: #555;
  text-align: center;
  margin-top: 12px;
  line-height: 1.4;
}

.sf-privacy-note a {
  color: #1ED891;
  text-decoration: none;
}

.sf-privacy-note a:hover {
  text-decoration: underline;
}

/* Mobile Responsive Styles */
@media (max-width: 540px) {
  .sf-modal-content {
    padding: 24px 20px;
  }
  
  .sf-modal-header {
    margin-bottom: 20px;
  }
  
  .sf-modal-title {
    font-size: 22px;
  }
  
  .sf-modal-subtitle {
    font-size: 13px;
  }
  
  .sf-form-input {
    padding: 13px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .sf-form-submit {
    padding: 15px 20px;
  }
  
  .sf-form-textarea {
    min-height: 70px;
  }
}

/* Prevent page scrolling when modal is open */
body.sf-modal-open {
  overflow: hidden;
}

