/* ===== ADIABATIC COMPONENTS ===== */

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    background: var(--secondary);
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    border-radius: 7px;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    min-height: 48px;
    white-space: nowrap;
    text-transform: uppercase;
    appearance: none;

    /* Touch optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }
}

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

.btn--secondary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

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

.btn--gradient {
    background: linear-gradient(to right, #D42721, #F34D1F);
    color: var(--white);
    border-radius: 30px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 10%);
    border: none;
}

@media (hover: hover) {
    .btn--gradient:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgb(0 0 0 / 15%);
    }
}

.btn--large {
    padding: var(--space-4) var(--space-8);
    font-size: 1.1rem;
}

.btn--small {
    padding: var(--space-2) var(--space-4);
    font-size: 0.9rem;
    min-height: 40px;
}

/* Focus styles */
.btn:focus {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

/* ===== CARDS ===== */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

@media (width >= 640px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (width >= 1024px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}

@media (hover: hover) {
    .card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
        border-color: var(--secondary);
    }
}

.card-image {
    width: 100%;
    height: 200px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary);
}

.card-content {
    padding: var(--space-6);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-3);
    text-decoration: none;
}

@media (hover: hover) {
    .card-title:hover {
        color: var(--red-light);
    }
}

.card-description {
    color: var(--gray-600);
    margin-bottom: var(--space-4);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--primary);
    font-weight: 600;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: var(--space-3);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-base);
    transition: var(--transition);
    appearance: none;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(49 60 72 / 10%);
}

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

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    right: var(--space-6);
    background: var(--secondary);
    color: var(--primary);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    z-index: 100;
    bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
    appearance: none;
}

@media (hover: hover) {
    .back-to-top:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }
}

/* ===== UTILITY CLASSES ===== */

/* Background */
.bg-gray {
    background: var(--gray-50);
}

.bg-white {
    background: var(--white);
}

/* Text */
.text-left {
    text-align: left;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-muted {
    color: var(--gray-600);
}

/* Spacing - margin bottom */
.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-3 {
    margin-bottom: var(--space-3);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

/* Spacing - margin top */
.mt-2 {
    margin-top: var(--space-2);
}

.mt-3 {
    margin-top: var(--space-3);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mt-12 {
    margin-top: var(--space-12);
}

/* Spacing - padding */
.p-6 {
    padding: var(--space-6);
}

.p-8 {
    padding: var(--space-8);
}

/* Layout */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* Max-width containers */
.max-w-800 {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Grid helpers */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

/* Stats card */
.stats-card {
    text-align: center;
    padding: var(--space-8);
}

.stats-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: var(--space-3);
}

.stats-title {
    color: var(--accent);
    margin-bottom: var(--space-2);
}

.stats-description {
    color: var(--gray-600);
}

/* Additional utility classes for inline style replacement */
.text-primary {
    color: var(--primary);
}

.text-accent {
    color: var(--accent);
}

.fs-2rem {
    font-size: 2rem;
}

.fs-1-1rem {
    font-size: 1.1rem;
}

.fw-800 {
    font-weight: 800;
}

.lh-1-7 {
    line-height: 1.7;
}

.m-auto {
    margin-left: auto;
    margin-right: auto;
}

.mb-0 {
    margin-bottom: 0;
}

.fw-600 {
    font-weight: 600;
}

/* ===== CTA SECTION ===== */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
}

.cta-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: var(--space-4);
    text-transform: uppercase;
}

.cta-description {
    font-size: 1.1rem;
    margin-bottom: var(--space-8);
    opacity: 0.9;
}

/* Mobile CTA styles */
@media (width <= 768px) {
    .cta-title {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .cta-description {
        font-size: 1rem;
    }
}

/* ===== FORM VALIDATION ERRORS ===== */
.field-error {
    color: var(--secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.form__input.error,
input.error,
textarea.error,
select.error {
    border-color: var(--secondary);
}
