/* Apply Page Specific Styles */

body.apply-page,
body.apply-page.apply-page,
.apply-page {
  background: #FAF8F5 !important;
  background-color: #FAF8F5 !important;
  min-height: 100vh;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1a1a1a; /* Dark gray text */
  display: flex;
  flex-direction: column;
}

/* Header integration */
.apply-page .site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 1000;
  background: rgba(245, 245, 240, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(26, 26, 26, 0.1);
}

.apply-page .site-header .container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 24px 40px;
  height: 80px;
}

.apply-page .site-header.apply-header-logo-only .container {
  display: flex !important;
  justify-content: flex-start;
  align-items: center;
  grid-template-columns: none;
}

.apply-page .logo {
  color: #1a1a1a;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.02em;
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.apply-page .site-header .nav {
  display: flex;
  align-items: center;
  gap: 240px;
  margin: 0;
  justify-self: center;
  grid-column: 2;
  min-width: 750px;
  justify-content: center;
  color: rgba(26, 26, 26, 0.9);
}

.apply-page .nav a {
  color: rgba(26, 26, 26, 0.9);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: opacity 0.2s ease;
  letter-spacing: 0.01em;
}

.apply-page .nav a:hover {
  opacity: 0.6;
  color: #1a1a1a;
}

.apply-page .nav a.active {
  opacity: 1;
  color: #1a1a1a;
}

/* Footer styles for apply page - Completely independent */
body.apply-page footer.site-footer,
body.apply-page .site-footer,
footer.site-footer.apply-footer,
body.apply-page footer.site-footer.apply-footer,
body.apply-page .apply-footer,
.apply-page footer.apply-footer {
  background: #FAF8F5 !important;
  background-color: #FAF8F5 !important;
  border-top: 1px solid rgba(26, 26, 26, 0.1) !important;
  margin-top: auto !important;
  position: relative !important;
  width: 100% !important;
  padding: 0 !important;
  color: #1a1a1a !important;
}

body.apply-page .footer-container,
body.apply-page .site-footer .footer-container,
body.apply-page footer.site-footer .footer-container,
body.apply-page .apply-footer-container,
body.apply-page footer.apply-footer .apply-footer-container,
body.apply-page footer.site-footer.apply-footer .apply-footer-container,
.apply-page .apply-footer-container {
  background: transparent !important;
  max-width: var(--container) !important;
  margin: 0 auto !important;
  padding: 40px 24px !important;
}

/* Footer igual que success: logo + enlaces + Instagram + copyright */
.apply-page footer.apply-footer,
.apply-footer {
  padding: 0 !important;
}

.apply-footer .support-info.apply-footer-support {
  margin-top: 0;
  padding: 24px 24px 40px;
  border-top: 1px solid rgba(26, 26, 26, 0.1);
  width: 100%;
  box-sizing: border-box;
}

.apply-footer .support-footer-content {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 0;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
  width: 100%;
  box-sizing: border-box;
}

.apply-footer .success-logo {
  margin: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  line-height: 1;
  font-size: 0;
}

.apply-footer .success-logo-img {
  height: 18px;
  width: auto;
  display: block;
  filter: brightness(0);
}

.apply-footer .support-footer-right {
  display: flex;
  align-items: center;
  gap: 45px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.apply-footer .support-link {
  color: rgba(26, 26, 26, 0.7);
  text-decoration: none;
  font-size: 14px;
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: color 0.2s ease;
}

.apply-footer .support-link:hover {
  color: #1a1a1a;
}

.apply-footer .support-instagram-link {
  display: inline-flex;
  align-items: center;
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.3s ease;
}

.apply-footer .support-instagram-link:hover {
  color: rgba(26, 26, 26, 0.7);
}

.apply-footer .support-instagram-icon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  height: 18px;
}

.apply-footer .support-instagram-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.apply-footer .support-copyright {
  color: rgba(26, 26, 26, 0.7);
  font-size: 14px;
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  white-space: nowrap;
  line-height: 1;
}

.apply-page .footer-logo {
  color: #1a1a1a;
}

.apply-page .site-footer a {
  color: rgba(26, 26, 26, 0.8);
}

.apply-page .site-footer a:hover {
  color: #1a1a1a;
}

.apply-page .footer-copyright {
  color: rgba(26, 26, 26, 0.6);
}

.apply-page .social-link {
  color: rgba(26, 26, 26, 0.8);
}

.apply-page .social-link:hover {
  color: #1a1a1a;
}

/* Progress Bar */
.progress-container {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  background: rgba(245, 245, 240, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  box-shadow: none;
  border-bottom: 1px solid rgba(26, 26, 26, 0.1);
}

.progress-bar {
  height: 3px;
  background: rgba(26, 26, 26, 0.1);
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #c8128f;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 9.09%; /* Initial: 1/11 */
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(200, 18, 143, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-text {
  padding: 12px 20px;
  font-size: 14px;
  color: #1a1a1a;
  text-align: center;
  font-weight: 500;
  background: transparent;
  letter-spacing: 0.01em;
}

/* Onboarding Container */
.onboarding-container {
  max-width: 600px;
  margin: 180px auto 60px;
  padding: 0 24px;
}

.onboarding-card {
  background: transparent;
  border-radius: 0;
  padding: 56px 48px;
  box-shadow: none;
  min-height: 500px;
  position: relative;
  overflow: hidden;
  border: none;
}

.form-notice {
  font-size: 14px;
  color: rgba(26, 26, 26, 0.7);
  margin: 0 0 24px 0;
  text-align: center;
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
}

/* Steps */
.step {
  display: none;
  animation: fadeInSlide 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(10px);
}

.step.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.apply-page .step h2,
.step h2 {
  font-size: 32px;
  color: #1a1a1a !important;
  margin: 0 0 20px 0;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  font-family: Times, "Times New Roman", serif !important;
}

.step-description {
  color: rgba(26, 26, 26, 0.7);
  font-size: 16px;
  margin: 0 0 40px 0;
  line-height: 1.7;
  font-weight: 400;
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.step-description.small {
  font-size: 14px;
  font-style: italic;
  color: #666666;
  font-weight: 400;
  line-height: 1.6;
}

/* Success Icon */
.success-icon {
  width: 100px;
  height: 100px;
  background: #1a1a1a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  color: #F5F5F0;
  margin: 0 auto 28px;
  animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(26, 26, 26, 0.2);
  font-weight: 700;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

/* Input Groups */
.input-group {
  margin-bottom: 32px;
  position: relative;
}

/* Screen reader only - visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.input-group label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 10px;
  letter-spacing: 0.01em;
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Hide labels visually when using sr-only class */
.input-group label.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 8px 0;
  border: none;
  border-bottom: 1px solid rgba(26, 26, 26, 0.3);
  border-radius: 0;
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1a1a1a;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-bottom-color: rgba(26, 26, 26, 0.8);
  box-shadow: none;
}

.input-group input.error,
.input-group select.error {
  border-bottom-color: #ef4444;
  box-shadow: none;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.input-group input::placeholder {
  color: rgba(26, 26, 26, 0.5);
}

/* Links styling - underlined like in image */
a {
  color: rgba(26, 26, 26, 0.8);
  text-decoration: underline;
  text-decoration-color: rgba(26, 26, 26, 0.3);
  transition: text-decoration-color 0.2s;
}

a:hover {
  text-decoration-color: rgba(26, 26, 26, 0.6);
  color: #1a1a1a;
}

/* Buttons */
.btn-next {
  width: auto;
  padding: 0;
  background: transparent;
  color: #173C0B;
  border: none;
  border-radius: 0;
  font-size: 16px;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 12px;
  box-shadow: none;
  letter-spacing: 0.01em;
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.btn-next:hover {
  opacity: 0.8;
  transform: none;
  box-shadow: none;
  background: transparent;
  border: none;
}

.btn-next:active {
  opacity: 0.6;
  transform: none;
  box-shadow: none;
  background: transparent;
  border: none;
}

.btn-next::after {
  content: '→';
  font-size: 18px;
  transition: transform 0.2s ease;
}

.btn-next:hover::after {
  transform: translateX(4px);
}

.btn-next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-text {
  width: auto !important;
  padding: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  color: rgba(26, 26, 26, 0.6) !important;
  border: none !important;
  border-radius: 0 !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 12px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
  letter-spacing: 0.01em !important;
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.btn-text:hover {
  opacity: 0.8 !important;
  transform: none !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  color: rgba(26, 26, 26, 0.8) !important;
}

.btn-text::after {
  content: none !important;
}

.btn-text:hover::after {
  content: none !important;
  transform: none !important;
}

.apply-page .step-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 12px;
}

.apply-page .btn-back {
  width: auto;
  padding: 0;
  margin-top: 0;
  background: transparent;
  color: rgba(26, 26, 26, 0.55);
  border: none;
  border-radius: 0;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.01em;
  box-shadow: none;
}

.apply-page .btn-back::before {
  content: '←';
  margin-right: 6px;
}

.apply-page .btn-back:hover {
  color: rgba(26, 26, 26, 0.85);
  opacity: 1;
}

.apply-page .step-actions .btn-next {
  margin-top: 0;
}

/* Autocomplete Suggestions */
.suggestions-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #F5F5F0;
  border: 2px solid rgba(26, 26, 26, 0.2);
  border-top: none;
  border-radius: 0 0 12px 12px;
  max-height: 240px;
  overflow-y: auto;
  display: none;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(26, 26, 26, 0.12);
}

.suggestion-item {
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #1a1a1a;
  font-weight: 500;
}

.suggestion-item:hover {
  background: rgba(26, 26, 26, 0.08);
  color: #1a1a1a;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 26, 26, 0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #F5F5F0;
  padding: 40px;
  border-radius: 20px;
  max-width: 450px;
  width: 90%;
  text-align: center;
  animation: slideUp 0.4s ease;
  box-shadow: 0 20px 60px rgba(26, 26, 26, 0.2);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h3 {
  font-size: 26px;
  margin: 0 0 14px 0;
  color: #1a1a1a;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-family: 'Playfair Display', Georgia, serif;
}

.modal-content p {
  color: #1a1a1a;
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 400;
}

.confirm-value {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 20px 0 28px 0;
  padding: 16px;
  background: rgba(26, 26, 26, 0.05);
  border-radius: 4px;
  border: 1px solid rgba(26, 26, 26, 0.2);
}

.modal-actions {
  display: flex;
  gap: 14px;
  margin-top: 28px;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: #1a1a1a;
  color: #F5F5F0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: #2a2a2a;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: #F5F5F0;
  color: #1a1a1a;
  border: 1px solid rgba(26, 26, 26, 0.2);
}

.btn-secondary:hover {
  background: #e8e8e3;
  border-color: rgba(26, 26, 26, 0.3);
}

/* Loading Spinner */
.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(26, 26, 26, 0.1);
  border-top: 4px solid #1a1a1a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 90px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.toast {
  background: #F5F5F0;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(26, 26, 26, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid;
  min-width: 300px;
}

.toast.success {
  border-left-color: #1a1a1a;
}

.toast.error {
  border-left-color: #d32f2f;
}

.toast.info {
  border-left-color: #1a1a1a;
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast.success .toast-icon {
  color: #1a1a1a;
}

.toast.error .toast-icon {
  color: #d32f2f;
}

.toast.info .toast-icon {
  color: #1a1a1a;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: rgba(17, 17, 17, 1);
  line-height: 1.5;
}

.toast-close {
  background: none;
  border: none;
  font-size: 18px;
  color: rgba(17, 17, 17, 0.5);
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.toast-close:hover {
  color: rgba(17, 17, 17, 1);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.hiding {
  animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 600px) {
  .onboarding-container {
    margin: 100px auto 40px;
    padding: 0 16px;
  }

  .onboarding-card {
    padding: 32px 24px;
    border-radius: 16px;
  }

  .step h2 {
    font-size: 24px;
  }

  .step-description {
    font-size: 15px;
    margin-bottom: 32px;
  }

  .modal-content {
    padding: 24px;
    width: 95%;
  }

  .modal-actions {
    flex-direction: column;
  }

  .toast-container {
    right: 16px;
    left: 16px;
    max-width: none;
  }

  .toast {
    min-width: auto;
  }

  .progress-container {
    top: 70px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .step,
  .success-icon,
  .modal,
  .modal-content,
  .toast,
  .progress-fill::after {
    animation: none;
  }

  .btn-next:hover,
  .btn-text:hover,
  .input-group input:focus {
    transform: none;
  }
}

/* Focus visible for keyboard navigation */
.btn-next:focus-visible,
.btn-text:focus-visible,
.input-group input:focus-visible,
.input-group select:focus-visible {
  outline: 3px solid var(--accent, #e6eb5e);
  outline-offset: 2px;
}

/* Improved input states */
.input-group input:valid:not(:placeholder-shown) {
  border-color: rgba(230, 235, 94, 0.5);
}

.input-group input:invalid:not(:placeholder-shown):not(:focus) {
  border-color: #ef4444;
}

/* Force body background color with maximum specificity */
body.apply-page {
  background: #FAF8F5 !important;
  background-color: #FAF8F5 !important;
}

/* Force footer background color with maximum specificity - Independent styles */
body.apply-page footer.site-footer,
body.apply-page .site-footer,
body.apply-page footer.site-footer.apply-footer,
body.apply-page footer.apply-footer,
body.apply-page .apply-footer,
footer.site-footer.apply-footer,
footer.apply-footer {
  background: #FAF8F5 !important;
  background-color: #FAF8F5 !important;
  border-top: 1px solid rgba(26, 26, 26, 0.1) !important;
  margin-top: auto !important;
  position: relative !important;
  width: 100% !important;
  padding: 0 !important;
}

body.apply-page .footer-container,
body.apply-page .site-footer .footer-container,
body.apply-page footer.site-footer .footer-container,
body.apply-page .apply-footer-container,
body.apply-page footer.apply-footer .apply-footer-container,
body.apply-page footer.site-footer.apply-footer .apply-footer-container,
.footer-container.apply-footer-container,
.apply-footer-container {
  background: #FAF8F5 !important;
  background-color: #FAF8F5 !important;
  max-width: var(--container) !important;
  margin: 0 auto !important;
  padding: 40px 40px !important;
}
