/* Modern CSS Variables - Updated for Accessibility */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #f3f4f6;
    --accent-color: #fbbf24;
    --text-primary: #111827;
    --text-secondary: #374151; /* Darkened for better contrast */
    --text-light: #4b5563; /* Improved from #9ca3af for accessibility */
    --background: #ffffff;
    --background-alt: #f9fafb;
    --border: #d1d5db; /* Slightly darker for better visibility */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-warm: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
}

/* Skip Link for Keyboard Navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Universal Focus Styles for Accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Remove default focus for mouse users, keep for keyboard */
.js-focus-visible *:focus:not(.focus-visible) {
    outline: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Crimson Text', serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
}

.nav-tagline {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 300;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 8px 4px; /* Add padding for larger touch target */
    border-radius: 4px;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--primary-color);
}

.nav-cta {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px; /* Minimum touch target size */
}

.nav-cta:hover,
.nav-cta:focus {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--focus-ring);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding-top: 70px;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.highlight {
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: var(--shadow);
    min-height: 44px;
    text-decoration: none;
}

.primary-opposite-btn {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 16px 32px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: var(--shadow);
    min-height: 44px;
    text-decoration: none;
}

.primary-opposite-btn:hover,
.primary-opposite-btn:focus {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.primary-btn:hover,
.primary-btn:focus {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.primary-btn.large {
    padding: 20px 40px;
    font-size: 1.2rem;
}

.primary-opposite-btn.large {
    padding: 20px 40px;
    font-size: 1.2rem;
}

.btn-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 400;
    margin-top: 4px;
}

.secondary-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border);
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    text-decoration: none;
}

.secondary-btn:hover,
.secondary-btn:focus {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.hero-trust {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trust-text {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Memory Card Component */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Enhanced Memory Card with Emotional Elements */
.memory-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: 
        0 20px 25px -5px rgba(209, 140, 163, 0.1), 
        0 8px 10px -6px rgba(209, 140, 163, 0.1),
        0 0 0 1px rgba(209, 140, 163, 0.05);
    max-width: 400px;
    animation: float 6s ease-in-out infinite;
    border: 1px solid rgba(209, 140, 163, 0.2);
    position: relative;
    overflow: hidden;
}

/* Memory icon (candle) */
.memory-icon {
    font-size: 1.2rem;
    opacity: 0.7;
    margin-left: auto;
    animation: flicker 3s ease-in-out infinite;
    /* Add role and aria-label in HTML for screen readers */
}

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

/* Enhanced pet avatar */
.pet-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D48CA3 0%, #E1B56A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 12px rgba(212, 140, 163, 0.3);
}

/* Enhanced card tag */
.card-tag {
    background: linear-gradient(135deg, #B8A1CE 0%, #D48CA3 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(184, 161, 206, 0.3);
}

/* Smooth transitions for story rotation */
.memory-card {
    transition: opacity 0.5s ease-in-out;
}

.memory-card-content p {
    transition: all 0.3s ease-in-out;
}

.pet-info h3, .pet-info span {
    transition: all 0.3s ease-in-out;
}

.card-tag {
    transition: all 0.3s ease-in-out;
}

/* Pause rotation on hover */
.memory-card:hover {
    animation-play-state: paused;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.memory-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pet-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.pet-info h3 {
    font-size: 1.25rem;
    margin: 0;
}

.pet-info span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.memory-card-content p {
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.card-tag {
    background: var(--secondary-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* How It Works Section */
.how-it-works {
    padding: 5rem 0;
    background: var(--background);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 auto 1.5rem;
}

.step h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.step p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.cta-section {
    text-align: center;
}

/* Examples Section */
.examples {
    padding: 5rem 0;
    background: var(--background-alt);
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.example-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.example-card:hover,
.example-card:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.example-header {
    margin-bottom: 1.5rem;
}

.example-pet {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pet-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.pet-icon.dog { 
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}
.pet-icon.cat { 
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}
.pet-icon.bird { 
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}
.pet-icon.dog::before { content: '🐕'; }
.pet-icon.cat::before { content: '🐱'; }
.pet-icon.bird::before { content: '🐦'; }

.example-pet h4 {
    margin: 0;
    font-size: 1.1rem;
}

.example-pet span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.example-content p {
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.example-type {
    background: var(--secondary-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Pricing Section */
.pricing {
    padding: 5rem 0;
    background: var(--background);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.pricing-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card:hover,
.pricing-card:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.pricing-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 4px 16px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
}

.pricing-header h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.pricing-features {
    margin: 2rem 0;
    text-align: left;
}

.feature {
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.pricing-btn {
    width: 100%;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    min-height: 44px;
}

.pricing-btn.primary {
    background: var(--primary-color);
    color: white;
}

.pricing-btn.primary:hover,
.pricing-btn.primary:focus {
    background: var(--primary-dark);
}

/* Final CTA */
.final-cta {
    padding: 5rem 0;
    background: var(--gradient-primary);
    color: white;
    text-align: center;
}

.final-cta .primary-btn, .final-cta .primary-opposite-btn {
    margin: 0 auto;
    display: inline-flex;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand h3 {
    color: white;
    margin-bottom: 1rem;
}

.footer-brand p {
    opacity: 0.8;
    line-height: 1.6;
}

.footer-column h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-link {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
    padding: 4px 0;
    border-radius: 4px;
}

.footer-link:hover,
.footer-link:focus {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.6;
}

/* Modal Styles - Enhanced for Accessibility */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--background);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-close {
    color: var(--text-light);
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
    z-index: 2001;
    background: none;
    border: none;
    padding: 8px;
    border-radius: 4px;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--text-primary);
    background: var(--secondary-color);
}

.modal-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.modal-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.modal-header p {
    color: var(--text-secondary);
}

.tribute-form {
    padding: 0 2rem 2rem;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.form-step h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
    min-height: 44px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Enhanced Radio Button Accessibility */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 44px;
}

.radio-label:hover {
    border-color: var(--primary-color);
    background-color: var(--background-alt);
}

.radio-label:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    border: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
}

.radio-label input[type="radio"]:focus + .radio-custom {
    box-shadow: var(--focus-ring);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 2rem;
}

.result-content {
    text-align: center;
}

.tribute-preview {
    background: var(--background-alt);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    font-style: italic;
    line-height: 1.7;
    border: 1px solid var(--border);
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.how-it-works .cta-section {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.how-it-works .primary-btn .primary-opposite-btn {
    margin: 0 auto;
}

/* Language Switcher - Enhanced Accessibility */
.language-switcher {
    position: relative;
    display: inline-block;
    margin-left: 16px;
}

.language-button {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 44px;
}

.language-button:hover,
.language-button:focus {
    background-color: var(--background-alt);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 1000;
    display: none;
}

.language-dropdown.show {
    display: block;
}

.language-option {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background-color 0.2s ease;
    min-height: 44px;
}

.language-option:hover,
.language-option:focus {
    background-color: var(--background-alt);
    color: var(--primary-color);
}

.language-option.active {
    background-color: #eff6ff;
    color: var(--primary-color);
}

.flag-icon {
    width: 16px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

.flag-icon.en {
    background-image: url('https://cdn.jsdelivr.net/npm/flag-icons@6.6.6/flags/4x3/us.svg');
    background-size: cover;
    background-position: center;
}

.flag-icon.es {
    background-image: url('https://cdn.jsdelivr.net/npm/flag-icons@6.6.6/flags/4x3/es.svg');
    background-size: cover;
    background-position: center;
}

.flag-icon.fr {
    background-image: url('https://cdn.jsdelivr.net/npm/flag-icons@6.6.6/flags/4x3/fr.svg');
    background-size: cover;
    background-position: center;
}

.chevron-down {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--text-light);
    transition: transform 0.2s ease;
}

.language-button.open .chevron-down {
    transform: rotate(180deg);
}

/* Notification System for Accessibility */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 16px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    animation: slideInRight 0.3s ease-out;
    max-width: 400px;
}

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #ef4444;
}

.notification.warning {
    background: #f59e0b;
}

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

/* Screen Reader Only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    border: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Focus visible polyfill support */
.js-focus-visible :focus:not(.focus-visible) {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-secondary: #000000;
        --text-light: #000000;
        --border: #000000;
    }
    
    .primary-btn,
    .primary-opposite-btn {
        border: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .memory-card {
        animation: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }
    
    .nav-link {
        display: none;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-actions {
        align-items: center;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .steps {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .example-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-card.featured {
        transform: none;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .language-switcher {
        margin-left: 8px;
    }
    
    .language-button {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .language-dropdown {
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .primary-btn.large {
        padding: 16px 32px;
        font-size: 1.1rem;
    }
    
    .primary-opposite-btn.large {
        padding: 16px 32px;
        font-size: 1.1rem;
    }    

    .memory-card {
        padding: 1.5rem;
    }
    
    .modal-content {
        margin: 5% auto;
    }
    
    .tribute-form {
        padding: 0 1rem 1rem;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Form Validation Styles */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}