/*
 * Equilibrio Financiero - Custom Styles
 * Brand color: #f2b705 (golden amber)
 */

/* ============================================================
   BRAND COLOR OVERRIDES
   Override Tailwind's indigo palette with brand golden tones
   ============================================================ */
:root {
  --color-indigo-50: #fff7d1;
  --color-indigo-100: #fff0a3;
  --color-indigo-200: #ffe366;
  --color-indigo-300: #ffd633;
  --color-indigo-400: #f5c400;
  --color-indigo-500: #f2b705;
  --color-indigo-600: #f2b705;
  --color-indigo-700: #d49904;
  --color-indigo-800: #a87803;
  --color-indigo-900: #7c5902;
}

/* ============================================================
   MODALS
   ============================================================ */
turbo-frame#modal {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 60;
  overflow-y: auto;
}

turbo-frame#modal:not(:empty) {
  display: flex;
}

turbo-frame#modal > div {
  animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s ease-out forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease-out forwards;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Staggered animation delays for lists */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ============================================================
   DISABLED INPUTS
   ============================================================ */
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ============================================================
   CURP INPUT STYLES
   ============================================================ */
input[data-curp-validation-target="curpInput"]:focus,
input[data-aval-curp-validation-target="curpInput"]:focus,
input[data-credit-wizard-target="curpInput"]:focus,
input[data-credit-wizard-target="avalCurpInput"]:focus {
  box-shadow: 0 0 0 4px rgba(242, 183, 5, 0.15);
}

input[data-curp-validation-target="curpInput"]::placeholder,
input[data-aval-curp-validation-target="curpInput"]::placeholder,
input[data-credit-wizard-target="curpInput"]::placeholder,
input[data-credit-wizard-target="avalCurpInput"]::placeholder {
  letter-spacing: 0.15em;
}

/* ============================================================
   TABLE IMPROVEMENTS
   ============================================================ */
table tbody tr {
  transition: background-color 0.15s ease;
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.4);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(148, 163, 184, 0.6);
}

/* ============================================================
   SIDEBAR TRANSITIONS
   ============================================================ */
.sidebar-transition {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.overlay-transition {
  transition: opacity 0.3s ease;
}

/* ============================================================
   DARK MODE - Additional overrides
   ============================================================ */
.dark turbo-frame#modal {
  background-color: rgba(0, 0, 0, 0.7);
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(100, 116, 139, 0.5);
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 116, 139, 0.7);
}

/* ============================================================
   CARD HOVER EFFECTS
   ============================================================ */
.card-hover {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-hover:hover {
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 10px -6px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.dark .card-hover:hover {
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.3), 0 4px 10px -6px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   FOCUS STYLES
   ============================================================ */
.focus-ring:focus-visible {
  outline: 2px solid #f2b705;
  outline-offset: 2px;
}

/* ============================================================
   GRADIENT ACCENTS
   ============================================================ */
.brand-gradient {
  background: linear-gradient(135deg, #f2b705 0%, #d49904 100%);
}

.dark .brand-gradient {
  background: linear-gradient(135deg, #f2b705 0%, #f5c400 100%);
}

/* ============================================================
   OTP MODAL
   ============================================================ */
.otp-overlay-transition {
  transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
  opacity: 0;
}

.otp-overlay-visible {
  opacity: 1;
}

.otp-modal-transition {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  transform: scale(0.95) translateY(10px);
  opacity: 0;
}

.otp-overlay-visible .otp-modal-transition,
.otp-modal-visible {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* OTP input focus animation */
.otp-input-focus:focus {
  border-color: #f2b705;
  box-shadow: 0 0 0 3px rgba(242, 183, 5, 0.2);
  transform: scale(1.05);
}

.otp-input-focus {
  transition: all 0.15s ease;
}

/* OTP input filled state */
.otp-input-focus:not(:placeholder-shown) {
  border-color: #f2b705;
  background-color: rgba(242, 183, 5, 0.04);
}

.dark .otp-input-focus:not(:placeholder-shown) {
  background-color: rgba(242, 183, 5, 0.08);
}
