/* =====================================================================
   COMPONENTS - Reusable UI Elements
   Buttons, Cards, Forms, Badges, FAQ, Error States
   ===================================================================== */

/* ==========================================
   BUTTONS
   ========================================== */

/* Primary Button - Dark bg, white text */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    font-family: var(--font-family);
    font-size: var(--text-md);
    font-weight: var(--font-semibold);
    letter-spacing: -0.01em;
    line-height: var(--leading-tight);
    text-decoration: none;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
    min-width: 160px;
    min-height: 46px;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.1);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-bg),
                0 0 0 4px var(--color-primary);
}

.btn-primary:active {
    background: var(--color-primary);
}

/* Secondary Button - Transparent bg, border */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: var(--text-md);
    font-weight: var(--font-semibold);
    letter-spacing: -0.01em;
    line-height: var(--leading-tight);
    text-decoration: none;
    border: 1px solid var(--color-border-hover);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease-out),
                background var(--duration-fast) var(--ease-out);
    min-width: 160px;
    min-height: 46px;
}

.btn-secondary:hover {
    border-color: var(--color-border-focus);
    background: var(--color-bg-hover);
}

.btn-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-bg),
                0 0 0 4px var(--color-primary);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    min-width: auto;
    min-height: 36px;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
    min-height: 56px;
}

/* Button with Icon */
.btn-icon {
    width: 1rem;
    height: 1rem;
}

/* Mobile Button Adjustments */
@media (max-width: 480px) {
    .btn-primary,
    .btn-secondary {
        padding: 0.875rem 1.5rem;
        font-size: var(--text-base);
        width: 100%;
        max-width: 280px;
    }
}

/* ==========================================
   FEATURE CARDS
   ========================================== */

.feature-card {
    text-align: center;
    padding: var(--space-6) var(--space-4);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

.feature-card:hover {
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-sm);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-4) auto;
    color: var(--color-text);
    background: var(--color-bg-hover);
    border-radius: 50%;
}

.feature-icon svg,
.feature-icon [data-lucide] {
    width: 28px;
    height: 28px;
}

.feature-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text);
    margin: 0 0 var(--space-3) 0;
}

.feature-description {
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    color: var(--color-text-muted);
    margin: 0;
}

@media (min-width: 768px) {
    .feature-card {
        padding: var(--space-8) var(--space-6);
    }

    .feature-icon {
        width: 64px;
        height: 64px;
        margin-bottom: var(--space-6);
    }

    .feature-icon svg,
    .feature-icon [data-lucide] {
        width: 32px;
        height: 32px;
    }

    .feature-title {
        font-size: var(--text-xl);
        margin-bottom: var(--space-4);
    }
}

/* ==========================================
   BENEFIT CARDS
   ========================================== */

.benefit-card {
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

.benefit-card:hover {
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-sm);
}

.benefit-icon {
    width: 3rem;
    height: 3rem;
    background: var(--color-bg-hover);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4) auto;
    color: var(--color-text-muted);
}

.benefit-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.benefit-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text);
    margin: 0 0 var(--space-3) 0;
}

.benefit-description {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: var(--leading-relaxed);
    margin: 0;
}

/* ==========================================
   BADGES
   ========================================== */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    border-radius: var(--radius-full);
    background: var(--color-bg-hover);
    color: var(--color-text);
}

.badge-primary {
    background: var(--color-primary);
    color: var(--color-text-inverse);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-accent-green);
}

/* ==========================================
   FORMS - Light Theme
   ========================================== */

.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: var(--space-4) 0;
    font-family: var(--font-family);
    font-size: var(--text-lg);
    font-weight: var(--font-normal);
    color: var(--color-text);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-border-hover);
    border-radius: 0;
    outline: none;
    transition: border-color var(--duration-fast) var(--ease-out);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-subtle);
}

.form-input:focus,
.form-textarea:focus {
    border-bottom-color: var(--color-primary);
    border-bottom-width: 2px;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: var(--leading-relaxed);
}

/* Form Validation */
.form-input.error,
.form-textarea.error {
    border-bottom-color: var(--color-accent-red);
}

.form-error {
    color: var(--color-accent-red);
    font-size: var(--text-sm);
    margin-top: var(--space-2);
}

/* ==========================================
   FAQ ACCORDION
   ========================================== */

.faq-container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-5) 0;
}

.faq-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    margin-bottom: 0;
    overflow: hidden;
    transition: all var(--duration-slow) var(--ease-in-out);
    scroll-margin-top: 100px;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item:hover {
    border-color: var(--color-border-hover);
}

.faq-item.active {
    border-color: var(--color-border-hover);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-8) 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    color: var(--color-text);
    transition: color var(--duration-fast) var(--ease-out);
    font-family: var(--font-family);
    letter-spacing: var(--tracking-tight);
}

.faq-question:hover {
    color: var(--color-text-muted);
}

.faq-question span {
    flex: 1;
    padding-right: var(--space-6);
    line-height: var(--leading-normal);
}

.faq-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--color-text-subtle);
    transition: all var(--duration-slow) var(--ease-in-out);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: var(--color-text-muted);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration-slower) var(--ease-in-out);
    background: transparent;
}

.faq-answer p {
    padding: 0 0 var(--space-8) 0;
    margin: 0;
    color: var(--color-text-muted);
    line-height: var(--leading-loose);
    font-size: var(--text-md);
    font-family: var(--font-family);
}

.faq-answer ul {
    padding: 0 0 var(--space-4) var(--space-5);
    margin: var(--space-2) 0;
    color: var(--color-text-muted);
    line-height: var(--leading-loose);
    font-size: var(--text-md);
}

.faq-answer a {
    color: var(--color-accent-blue);
    font-weight: var(--font-medium);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease-out);
}

.faq-answer a:hover {
    color: var(--color-primary);
    background: rgba(0, 102, 204, 0.1);
}

@media (max-width: 768px) {
    .faq-question {
        font-size: var(--text-md);
        padding: var(--space-6) 0;
    }

    .faq-answer p {
        font-size: var(--text-base);
        padding-bottom: var(--space-6);
    }
}

/* ==========================================
   ERROR STATES
   ========================================== */

.error-container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-4);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.error-icon {
    font-size: 80px;
    margin-bottom: var(--space-8);
    color: #f59e0b;
    display: inline-block;
    animation: fadeInScale 0.6s var(--ease-out);
}

.error-heading {
    color: var(--color-text);
    margin-bottom: var(--space-4);
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
}

.error-message {
    color: var(--color-text-muted);
    font-size: var(--text-md);
    margin-bottom: var(--space-10);
    line-height: var(--leading-relaxed);
}

.error-actions {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    padding: var(--space-7) var(--space-6);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-10);
}

.error-actions-title {
    margin: 0 0 var(--space-5) 0;
    color: var(--color-text);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
}

.error-actions-list {
    text-align: left;
    display: inline-block;
    margin: 0;
    padding-left: var(--space-6);
    list-style: none;
}

.error-actions-list li {
    margin-bottom: var(--space-3);
    color: var(--color-text-muted);
    line-height: var(--leading-relaxed);
    position: relative;
    padding-left: var(--space-6);
}

.error-actions-list li::before {
    content: '\2192';
    position: absolute;
    left: 0;
    color: var(--color-accent-blue);
    font-weight: var(--font-semibold);
}

.error-actions-list a {
    color: var(--color-text);
    font-weight: var(--font-medium);
    border-bottom: 1px solid var(--color-border-hover);
    transition: all var(--duration-fast) var(--ease-out);
}

.error-actions-list a:hover {
    border-bottom-color: var(--color-text);
}

.error-support-button {
    padding: 0.875rem 2rem;
    text-decoration: none;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border-radius: var(--radius-lg);
    font-weight: var(--font-semibold);
    font-size: var(--text-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-slow) var(--ease-in-out);
    min-width: 180px;
    min-height: 48px;
}

.error-support-button:hover {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-md);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================
   BREADCRUMBS
   ========================================== */

.breadcrumb-nav {
    padding: var(--space-4) 0;
    background: transparent;
    border-bottom: 1px solid var(--color-border);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: var(--text-sm);
    flex-wrap: wrap;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
    color: var(--color-text-muted);
    margin-bottom: 0;
}

.breadcrumb-list li:not(:last-child)::after {
    content: "/";
    margin-left: var(--space-2);
    color: var(--color-text-subtle);
}

.breadcrumb-list a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

.breadcrumb-list a:hover {
    color: var(--color-text);
}

.breadcrumb-current {
    color: var(--color-text);
}

/* ==========================================
   LOADING SPINNER
   ========================================== */

.loading-spinner {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-text);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

.loading-spinner.hidden {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   SCROLL TO TOP BUTTON
   ========================================== */

.scroll-top-btn {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--duration-slow) var(--ease-in-out);
    z-index: var(--z-fixed);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-md);
}

.scroll-top-btn:focus-visible {
    outline: 2px solid var(--color-border-focus);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .scroll-top-btn {
        bottom: var(--space-6);
        right: var(--space-6);
        width: 44px;
        height: 44px;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

/* Fade In Section */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ease-out),
                transform 0.8s var(--ease-out);
}

.fade-in-section.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations */
.fade-in-section:nth-child(1) { transition-delay: 0.1s; }
.fade-in-section:nth-child(2) { transition-delay: 0.2s; }
.fade-in-section:nth-child(3) { transition-delay: 0.3s; }
.fade-in-section:nth-child(4) { transition-delay: 0.4s; }

.fade-in-section.fade-in-visible {
    will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
    .fade-in-section {
        opacity: 1;
        transform: none;
    }
}
