/* ============================================
   Truemed HSA Eligibility - Custom Styles
   ============================================ */

/* Smooth scrolling and font rendering */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #F8FAF9; /* truemed-bg fallback for sections below hero */
}

/* Prevent white flash on load */
html {
    background-color: #F8FAF9;
}

/* Logo styling */
.logo-img {
    transition: opacity 0.2s;
}

.logo-img:hover {
    opacity: 0.8;
}

/* Typing animation */
.typing-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
}

.typing-text::after {
    content: '';
}

.typing-text.typing::after {
    content: '|';
    animation: blink 0.7s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ============================================
   Button Styles
   ============================================ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-weight: 700;
    transition: all 0.2s;
    background-color: #153E35;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(50, 197, 163, 0.2);
    padding: 1rem 2rem;
    font-size: 1.125rem;
    cursor: pointer;
    border: none;
}

.btn-primary:hover {
    background-color: #1E5648;
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #153E35;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-weight: 700;
    transition: all 0.2s;
    background-color: #32C5A3;
    color: #153E35;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    cursor: pointer;
    border: none;
}

.btn-secondary:hover {
    background-color: #6ee7b7;
}

.btn-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #32C5A3;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-weight: 500;
    transition: all 0.2s;
    background-color: transparent;
    color: #153E35;
    border: 2px solid #153E35;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
}

.btn-outline:hover {
    background-color: #F8FAF9;
}

.btn-outline:focus {
    outline: none;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #153E35;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-weight: 700;
    transition: all 0.2s;
    background-color: transparent;
    color: #475569;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    cursor: pointer;
    border: none;
}

.btn-ghost:hover {
    color: #153E35;
    background-color: #f1f5f9;
}

/* ============================================
   Selection Buttons (for quiz)
   ============================================ */

.selection-btn-primary {
    width: 100%;
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: left;
    transition: all 0.2s;
    border: 2px solid transparent;
    background-color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.selection-btn-primary:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: rgba(50, 197, 163, 0.5);
}

.selection-btn-primary span {
    font-size: 1.125rem;
    font-weight: 500;
    color: #0f172a;
}

.selection-btn-primary i {
    color: #32C5A3;
    transition: transform 0.3s;
}

.selection-btn-primary:hover i {
    transform: translateX(4px);
}

.selection-btn-outline {
    width: 100%;
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: left;
    transition: all 0.2s;
    border: 2px solid #e2e8f0;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.selection-btn-outline:hover {
    border-color: #94a3b8;
    background-color: #f8fafc;
}

.selection-btn-outline span {
    font-size: 1.125rem;
    font-weight: 500;
    color: #475569;
}

.selection-btn-outline i {
    color: #94a3b8;
    transition: transform 0.3s;
}

.selection-btn-outline:hover i {
    transform: translateX(4px);
}

/* ============================================
   Step Sections (visibility)
   ============================================ */

.step-section.hidden {
    display: none;
}

/* ============================================
   Form Input Focus States
   ============================================ */

input:focus {
    outline: none;
}

/* ============================================
   Custom Spinner
   ============================================ */

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

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

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    .btn-primary,
    .btn-secondary,
    .btn-ghost {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   Hero Background - Animated Blobs
   ============================================ */

/* Entrance animation for blobs */
@keyframes blobEnter1 {
    0% {
        opacity: 0;
        transform: translate(-100px, 50px) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
}

@keyframes blobEnter2 {
    0% {
        opacity: 0;
        transform: translate(80px, -60px) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
}

@keyframes blobEnter3 {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Floating blob animations - faster and more movement */
@keyframes float1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(60px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-40px, 30px) scale(0.9);
    }
    75% {
        transform: translate(50px, 40px) scale(1.05);
    }
}

@keyframes float2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(-60px, 40px) scale(1.15);
    }
    66% {
        transform: translate(50px, -50px) scale(0.85);
    }
}

@keyframes float3 {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    20% {
        transform: translate(calc(-50% + 50px), calc(-50% + 40px)) scale(0.9);
    }
    40% {
        transform: translate(calc(-50% - 30px), calc(-50% - 50px)) scale(1.15);
    }
    60% {
        transform: translate(calc(-50% - 50px), calc(-50% + 30px)) scale(0.95);
    }
    80% {
        transform: translate(calc(-50% + 40px), calc(-50% - 30px)) scale(1.1);
    }
}

@keyframes gradientShift {
    0%, 100% {
        opacity: 0.4;
        background-position: 0% 50%;
    }
    50% {
        opacity: 0.6;
        background-position: 100% 50%;
    }
}

/* Hero background container */
.hero-bg {
    z-index: -1;
}

/* Animated gradient overlay */
.hero-gradient {
    background: radial-gradient(ellipse at 30% 20%, rgba(167, 243, 208, 0.4) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(50, 197, 163, 0.3) 0%, transparent 50%),
                linear-gradient(135deg, rgba(248, 250, 249, 0) 0%, rgba(167, 243, 208, 0.15) 50%, rgba(248, 250, 249, 0) 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease-in-out infinite;
}

/* Blob positioning and animations */
.hero-blob {
    will-change: transform, opacity;
}

.hero-blob-1 {
    top: -100px;
    right: -50px;
    opacity: 0;
    animation: 
        blobEnter1 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards,
        float1 8s ease-in-out 1.4s infinite;
}

.hero-blob-2 {
    bottom: -50px;
    left: -50px;
    opacity: 0;
    animation: 
        blobEnter2 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards,
        float2 10s ease-in-out 1.6s infinite;
}

.hero-blob-3 {
    top: 50%;
    left: 50%;
    opacity: 0;
    animation: 
        blobEnter3 1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards,
        float3 7s ease-in-out 1.1s infinite;
}

/* ============================================
   Rotating Words Animation
   ============================================ */

.rotating-word-container {
    display: inline-block;
    position: relative;
    min-width: 180px;
    text-align: left;
}

.rotating-word {
    display: inline-block;
    animation: wordFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes wordFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wordFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.rotating-word.fade-out {
    animation: wordFadeOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ============================================
   Respect prefers-reduced-motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .hero-blob,
    .hero-gradient {
        animation: none;
    }
    
    .hero-blob-3 {
        transform: translate(-50%, -50%);
    }
    
    .animate-fade-in,
    .animate-slide-up,
    .animate-scale-in {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
