/* Renova Custom Styles with Accessibility-First Design */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --font-family-primary: 'Inter', sans-serif;
    --font-family-heading: 'Playfair Display', serif;
    --emerald-green: #059669;
    --emerald-dark: #047857;
    --emerald-light: #10b981;
}

/* ===== ACCESSIBILITY-FIRST FOUNDATION ===== */

/* Universal Focus Styles */
:focus {
    outline: 3px solid var(--emerald-green) !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.3);
    border-radius: 4px;
}

/* Disable green focus outline for color swatches - they use Tailwind ring classes for selected state */
.color-swatch:focus,
.color-swatch:focus-visible,
button.color-swatch:focus,
button.color-swatch:focus-visible {
    outline: none !important;
    outline-offset: 0 !important;
    border-radius: 50% !important;
}

/* Override the global :focus box-shadow ONLY for unfocused swatches that don't have ring classes */
.color-swatch:focus:not(.ring-2):not([class*="ring-"]):not(.swatch-active),
.color-swatch:focus-visible:not(.ring-2):not([class*="ring-"]):not(.swatch-active) {
    box-shadow: none !important;
}

/* Color swatch selected state - shows dark circle outline */
.color-swatch.swatch-active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #334155 !important;
}

/* Enhanced focus for interactive elements */
.tier-card:focus,
.product-card:focus,
.recommendation-item:focus,
.feature-card:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15),
        0 0 0 3px var(--emerald-green);
}

/* Skip Links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--emerald-green);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 9999;
    transition: top 0.3s ease;
    font-weight: 500;
}

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

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

/* ===== BUTTON ANIMATION SYSTEM ===== */

/* spinner overlay (centered), hides text visually but preserves size */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

/* brief success "pop" */
.btn-success {
    outline: 2px solid rgba(16, 185, 129, 0.35);
    /* emerald-ish */
    outline-offset: 2px;
    transition: outline-color 0.15s ease;
}

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

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .btn-loading::after {
        animation: none;
    }
}

@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;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {

    .tier-card,
    .product-card,
    .recommendation-item,
    .feature-card {
        border: 2px solid;
        background: Canvas;
        color: CanvasText;
    }

    .btn {
        border: 2px solid ButtonText;
        background: ButtonFace;
        color: ButtonText;
    }

    .btn:hover,
    .btn:focus {
        background: Highlight;
        color: HighlightText;
    }

    .tier-card:focus,
    .tier-card.keyboard-focused {
        outline: 4px solid #000;
        background-color: #fff;
        box-shadow: 0 0 0 4px #000;
        border-color: #000;
    }
}

/* Enhanced tier card accessibility */
.tier-card.keyboard-focused {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.5);
    border-color: var(--emerald-green);
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

.tier-card.selected {
    border-color: var(--emerald-600);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.1) 100%);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2);
}

.tier-card[aria-selected="true"] {
    position: relative;
}

.tier-card[aria-selected="true"]::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid var(--emerald-green);
    border-radius: inherit;
    z-index: -1;
}

/* Recommendation widget accessibility */
.recommendation-widget:focus-within {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

/* Reduced motion adjustments for accessibility features */
@media (prefers-reduced-motion: reduce) {
    .tier-card.keyboard-focused {
        transform: none;
        transition: none;
    }
}

body {
    font-family: var(--font-family-primary);
    line-height: 1.6;
    color: var(--dark-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-family-heading);
    font-weight: 600;
}

/* Navigation */
.navbar-brand {
    font-family: var(--font-family-heading);
    letter-spacing: 2px;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding-top: 80px;
}

.hero-content .badge {
    font-size: 0.875rem;
    border-radius: 50px;
}

.signup-form .input-group {
    max-width: 500px;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.signup-form .form-control {
    border-radius: 50px 0 0 50px;
    padding: 15px 25px;
    font-size: 1.1rem;
}

.signup-form .btn {
    border-radius: 0 50px 50px 0;
    padding: 15px 30px;
    font-weight: 600;
}

/* Social Proof */
.social-proof {
    margin-top: 2rem;
}

.user-avatars {
    display: flex;
    margin-right: 10px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(45deg, #0d6efd, #6610f2);
    margin-left: -8px;
    border: 2px solid white;
    position: relative;
}

.avatar:first-child {
    margin-left: 0;
}

.stars {
    font-size: 0.875rem;
}

/* Hero Image */
.hero-image {
    padding: 2rem;
}

.image-placeholder {
    transition: transform 0.3s ease;
}

.image-placeholder:hover {
    transform: scale(1.05);
}

/* Feature Cards */
.feature-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

/* =============================================================================
   MOBILE & TABLET RESPONSIVE UTILITIES - Phase 1 Critical Fixes
   Following mobile.md implementation plan
   ============================================================================= */

/* Touch-friendly minimum sizes following WCAG guidelines */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive typography scaling */
@media (max-width: 480px) {
    h1 {
        font-size: 2rem !important;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.75rem !important;
        line-height: 1.2;
    }

    h3 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }

    h4 {
        font-size: 1.25rem !important;
        line-height: 1.3;
    }

    h5 {
        font-size: 1.125rem !important;
        line-height: 1.4;
    }

    h6 {
        font-size: 1rem !important;
        line-height: 1.4;
    }

    /* Body text optimization */
    body {
        font-size: 1rem;
        line-height: 1.6;
    }

    p {
        margin-bottom: 1rem;
    }

    /* Navigation improvements */
    .navbar-nav {
        padding: 1rem 0;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        font-size: 1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
}

@media (max-width: 768px) {

    /* Tablet and mobile spacing */
    .container,
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Form improvements */
    .form-control {
        min-height: 44px;
        font-size: 1rem !important;
        padding: 0.75rem !important;
    }

    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
    }

    /* Grid improvements */
    .row {
        margin-left: -0.75rem !important;
        margin-right: -0.75rem !important;
    }

    .col,
    .col-1,
    .col-2,
    .col-3,
    .col-4,
    .col-5,
    .col-6,
    .col-7,
    .col-8,
    .col-9,
    .col-10,
    .col-11,
    .col-12,
    .col-sm,
    .col-md,
    .col-lg,
    .col-xl {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {

    /* Tablet-specific optimizations */
    .container {
        max-width: 720px;
    }

    /* Touch-friendly elements for tablets */
    .btn {
        min-height: 40px;
        padding: 0.625rem 1.25rem;
    }

    .form-control {
        min-height: 40px;
    }
}

/* Responsive image utilities */
.responsive-img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.responsive-img-contain {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Mobile-first navigation utilities */
@media (max-width: 991px) {
    .navbar-collapse {
        background: white;
        border-radius: 0.5rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        margin-top: 1rem;
        padding: 1rem;
    }
}

/* Accessibility improvements for mobile */
@media (max-width: 768px) {

    /* Focus indicators */
    button:focus,
    input:focus,
    select:focus,
    textarea:focus,
    a:focus {
        outline: 2px solid #0d6efd !important;
        outline-offset: 2px !important;
    }

    /* Skip links for screen readers */
    .skip-link {
        position: absolute;
        top: -40px;
        left: 6px;
        background: #0d6efd;
        color: white;
        padding: 8px;
        text-decoration: none;
        transition: top 0.3s;
        z-index: 9999;
    }

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

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Collection Items */
.collection-item {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
}

.collection-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.collection-image {
    border-radius: 10px;
    overflow: hidden;
}

/* Reward Card */
.reward-card {
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    border: none !important;
}

.price-display {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
}

/* Pledge Page Styles */
.progress-indicator {
    padding: 2rem 0;
}

.step {
    position: relative;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.step.completed .step-circle {
    animation: pulse 2s infinite;
}

.step.active .step-circle {
    animation: bounce 1s ease-in-out;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(25, 135, 84, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
    }
}

@keyframes bounce {

    0%,
    20%,
    60%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    80% {
        transform: translateY(-5px);
    }
}

/* Reward Options */
.reward-option {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.reward-option:hover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.reward-option.border-primary {
    border-color: var(--primary-color) !important;
}

.reward-option.bg-primary-subtle {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Pledge Amount Card */
.pledge-amount-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e9ecef;
}

/* Benefits Card */
.benefits-card {
    background: rgba(25, 135, 84, 0.05);
    border-color: rgba(25, 135, 84, 0.2) !important;
}

/* Success/Cancel Pages */
.success-section,
.cancel-section,
.thank-you-section {
    min-height: 70vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
}

.success-icon,
.cancel-icon,
.celebration-icon {
    margin: 0 auto 2rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    border-bottom: none;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 50px;
    padding: 10px 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 15px 35px;
    font-size: 1.1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Input Groups */
.input-group .form-control {
    border-right: none;
}

.input-group .btn {
    border-left: none;
    border-radius: 0 50px 50px 0;
}

/* Badges */
.badge {
    border-radius: 50px;
    padding: 0.5em 1em;
    font-weight: 500;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
    background-color: rgba(25, 135, 84, 0.1);
}

.alert-danger {
    border-left-color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
}

.alert-info {
    border-left-color: var(--info-color);
    background-color: rgba(13, 202, 240, 0.1);
}

.alert-warning {
    border-left-color: var(--warning-color);
    background-color: rgba(255, 193, 7, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding-top: 100px;
    }

    .display-3 {
        font-size: 2.5rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    .signup-form .input-group {
        flex-direction: column;
        border-radius: 10px;
    }

    .signup-form .form-control {
        border-radius: 10px;
        margin-bottom: 10px;
    }

    .signup-form .btn {
        border-radius: 10px;
        width: 100%;
    }

    .social-proof {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .progress-indicator {
        padding: 1rem 0;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    .display-4 {
        font-size: 2rem;
    }

    .display-5 {
        font-size: 1.75rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        border-radius: 10px !important;
        margin-bottom: 0.5rem;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading States */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Utility Classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bg-gradient {
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
}

.shadow-soft {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.shadow-hover {
    transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(135deg, #0d6efd, #6610f2) border-box;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #212529 0%, #343a40 100%);
}

footer a {
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--primary-color) !important;
}

/* Print Styles */
@media print {

    .navbar,
    .btn,
    footer,
    .alert {
        display: none !important;
    }

    .container {
        max-width: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* Hide scrollbars for mobile carousels */
.scrollbar-hide {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}