/* ============================================
   DELIGHT: Luxury wellness micro-interactions
   ============================================ */

/* Scroll Reveal Base */
.js-reveal-ready [data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--duration-reveal) var(--ease-out-expo),
                transform var(--duration-reveal) var(--ease-out-expo);
}

.js-reveal-ready [data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children reveals */
.js-reveal-ready [data-reveal-stagger] > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--duration-reveal) var(--ease-out-expo),
                transform var(--duration-reveal) var(--ease-out-expo);
}

.js-reveal-ready [data-reveal-stagger].revealed > * {
    opacity: 1;
    transform: translateY(0);
}

.js-reveal-ready [data-reveal-stagger].revealed > *:nth-child(1) { transition-delay: 0s; }
.js-reveal-ready [data-reveal-stagger].revealed > *:nth-child(2) { transition-delay: 0.08s; }
.js-reveal-ready [data-reveal-stagger].revealed > *:nth-child(3) { transition-delay: 0.16s; }
.js-reveal-ready [data-reveal-stagger].revealed > *:nth-child(4) { transition-delay: 0.24s; }

/* Hero Entrance Animation */
@keyframes hero-fade-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.js-reveal-ready .hero-title {
    animation: hero-fade-up 0.8s var(--ease-out-expo) both;
}

.js-reveal-ready .hero-subtitle {
    animation: hero-fade-up 0.8s var(--ease-out-expo) 0.15s both;
}

.js-reveal-ready .hero .cta-button {
    animation: hero-fade-up 0.8s var(--ease-out-expo) 0.3s both;
}

/* Hero vertical line fade-in */
.js-reveal-ready .hero::after {
    animation: hero-fade-up 0.8s var(--ease-out-expo) 0.5s both;
}

/* Button Press Feedback */
.cta-button:active,
.buy-btn:active,
.auth-submit-btn:active,
.submit-btn:active,
.action-btn:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
}

/* Form Input Focus — Accent underline grows from center */
.auth-form .form-group {
    position: relative;
}

.auth-form .form-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-accent);
    transition: width 0.3s var(--ease-out-expo), left 0.3s var(--ease-out-expo);
}

.auth-form .form-group:focus-within::after {
    width: 100%;
    left: 0;
}

/* Credit Items — subtle hover lift */
.credit-item {
    transition: transform var(--duration-micro) ease;
}

.credit-item:hover {
    transform: translateY(-2px);
}

/* Toast Progress Bar */
@keyframes toast-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.toast {
    overflow: hidden;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    transform-origin: left;
    animation: toast-progress 5s linear forwards;
}

.toast.success .toast-progress {
    background: rgba(46, 125, 50, 0.6);
}

.toast.error .toast-progress {
    background: rgba(211, 47, 47, 0.6);
}

/* Success Checkmark SVG Draw Animation */
@keyframes checkmark-circle {
    to { stroke-dashoffset: 0; }
}

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

.checkmark-svg {
    width: 48px;
    height: 48px;
}

.checkmark-svg circle {
    stroke: var(--primary-accent);
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: checkmark-circle 0.6s var(--ease-out-expo) forwards;
}

.checkmark-svg path {
    stroke: var(--primary-accent);
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: checkmark-check 0.4s var(--ease-out-expo) 0.4s forwards;
}

/* Auth success icon — remove background when SVG is used */
.auth-message .message-icon:has(.checkmark-svg) {
    background: none;
    width: auto;
    height: auto;
    font-size: inherit;
}

/* Modal Entrance Refinement */
.modal-overlay {
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-overlay .modal-content {
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.3s var(--ease-out-expo), opacity 0.3s var(--ease-out-expo);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

/* Refined loading spinner */
.loading-spinner {
    border-width: 1.5px;
    width: 32px;
    height: 32px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .js-reveal-ready [data-reveal],
    .js-reveal-ready [data-reveal-stagger] > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .hero-title,
    .hero-subtitle,
    .hero .cta-button,
    .hero::after {
        animation: none !important;
    }

    .checkmark-svg circle,
    .checkmark-svg path {
        animation: none !important;
        stroke-dashoffset: 0 !important;
    }

    .toast-progress {
        animation: none !important;
    }

    .modal-overlay,
    .modal-overlay .modal-content {
        transition: none !important;
    }
}
