/* Aira Theme — App Styles
 * Extends TailwindCSS CDN with custom overrides.
 */

/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

img:is([sizes="auto" i], [sizes^="auto," i]) {
    contain-intrinsic-size: 3000px 1500px;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Body font */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Sidebar link style fallback */
.aira-sidebar-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: #374151;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
}

.aira-sidebar-link:hover {
    background-color: rgba(37, 99, 235, 0.05);
    color: #2563EB;
}

/* Score badge colors */
.score-green {
    color: #10B981;
}

.score-yellow {
    color: #F59E0B;
}

.score-red {
    color: #EF4444;
}

.score-bg-green {
    background-color: #ECFDF5;
}

.score-bg-yellow {
    background-color: #FFFBEB;
}

.score-bg-red {
    background-color: #FEF2F2;
}

/* Card base */
.aira-card {
    background: #fff;
    border: 1px solid #F3F4F6;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.aira-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Progress bar */
.aira-progress {
    height: 6px;
    border-radius: 3px;
    background: #F3F4F6;
    overflow: hidden;
}

.aira-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* Spinner */
.aira-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #E5E7EB;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: aira-spin 0.6s linear infinite;
}

@keyframes aira-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Comparison arrows */
.score-up::before {
    content: '▲';
    color: #10B981;
    margin-right: 0.25rem;
    font-size: 0.75rem;
}

.score-down::before {
    content: '▼';
    color: #EF4444;
    margin-right: 0.25rem;
    font-size: 0.75rem;
}

/* Pagination */
.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-links a,
.nav-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
}

.nav-links a {
    color: #374151;
    background: #F9FAFB;
}

.nav-links a:hover {
    background: #2563EB;
    color: #fff;
}

.nav-links .current {
    background: #2563EB;
    color: #fff;
}

/* WordPress menu items in sidebar */
.menu-item a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: #374151;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
}

.menu-item a:hover {
    background-color: rgba(37, 99, 235, 0.05);
    color: #2563EB;
}

/* ── Contact Form 7 Global Styles ── */
div.wpcf7-response-output {
    margin: 1.5rem 0 0 0 !important;
    padding: 1rem 1.25rem !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 1rem !important;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
}

div.wpcf7-response-output:empty {
    display: none !important;
}

/* Success */
div.wpcf7-mail-sent-ok {
    background-color: #ECFDF5 !important;
    border-color: #10B981 !important;
    color: #065F46 !important;
}

/* Validation Errors / General Errors */
div.wpcf7-validation-errors,
div.wpcf7-mail-sent-ng,
div.wpcf7-spam-blocked {
    background-color: #FEF2F2 !important;
    border-color: #EF4444 !important;
    color: #991B1B !important;
}

.wpcf7-not-valid-tip {
    color: #EF4444;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: block;
}

input.wpcf7-not-valid,
textarea.wpcf7-not-valid {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
}

/* ── Public beta pages ──
 * These structural styles intentionally do not depend on generated Tailwind
 * utilities, so spacing remains stable when templates change after a CSS build.
 */
.aira-register-shell {
    width: 100%;
}

.aira-register-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
    overflow: hidden;
    border: 1px solid #dbe4f0;
    border-radius: 2rem;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.1);
}

.aira-register-intro {
    position: relative;
    padding: 3.5rem;
    color: #fff;
    background:
        radial-gradient(circle at 90% 10%, rgba(96, 165, 250, 0.42), transparent 36%),
        linear-gradient(145deg, #172554 0%, #1d4ed8 58%, #2563eb 100%);
}

.aira-register-kicker {
    display: inline-flex;
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.aira-register-intro h1 {
    margin: 1.5rem 0 1rem;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.aira-register-intro > p {
    margin: 0;
    color: #dbeafe;
    font-size: 1.05rem;
    line-height: 1.7;
}

.aira-register-benefits {
    display: grid;
    gap: 1.25rem;
    margin: 2.25rem 0;
    padding: 0;
    list-style: none;
}

.aira-register-benefits li {
    display: grid;
    grid-template-columns: 1.75rem 1fr;
    column-gap: 0.75rem;
}

.aira-register-benefits li > span {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #bfdbfe;
    font-weight: 800;
}

.aira-register-benefits strong,
.aira-register-benefits small {
    grid-column: 2;
}

.aira-register-benefits strong {
    align-self: center;
    font-size: 0.95rem;
}

.aira-register-benefits small {
    margin-top: 0.2rem;
    color: #dbeafe;
    font-size: 0.82rem;
    line-height: 1.5;
}

.aira-register-intro .aira-register-note {
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    color: #bfdbfe;
    font-size: 0.78rem;
    line-height: 1.55;
}

.aira-register-card {
    align-self: center;
    padding: 2.5rem;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.aira-register-form {
    display: grid;
    gap: 1.25rem;
}

.aira-register-field > span {
    display: block;
    min-height: 1.25rem;
    margin-bottom: 0.5rem;
}

.aira-register-field input {
    display: block;
    width: 100%;
    min-height: 3rem;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    background: #fff;
    color: #0f172a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aira-register-field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.aira-register-consent {
    gap: 0.75rem;
    line-height: 1.5;
}

.aira-register-consent input {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
}

.aira-register-form button[type="submit"] {
    min-height: 3rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.2);
}

.aira-register-form button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.26);
}

.aira-register-errors {
    margin-top: 1.5rem;
}

.aira-methodology-card {
    padding: 1.75rem;
}

.aira-faq-item {
    padding: 1.5rem;
}

.aira-faq-item + .aira-faq-item {
    margin-top: 1rem;
}

.aira-privacy-sections {
    display: grid;
    gap: 2rem;
}

@media (max-width: 639px) {
    .aira-register-shell,
    .aira-methodology-page,
    .aira-privacy-page {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    .aira-register-card {
        padding: 1.5rem;
    }

    .aira-methodology-card,
    .aira-faq-item {
        padding: 1.25rem;
    }
}

@media (max-width: 860px) {
    .aira-register-layout {
        grid-template-columns: 1fr;
        border-radius: 1.5rem;
    }

    .aira-register-intro {
        padding: 2rem;
    }

    .aira-register-intro h1 {
        font-size: 2rem;
    }

    .aira-register-benefits {
        margin: 1.75rem 0;
    }
}

/* Keyboard and form accessibility. */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

#cf7-wrapper .aira-contact-label-text {
    display: block;
    margin-bottom: 0.5rem;
    color: #334155;
    font-size: 0.875rem;
    font-weight: 600;
}

#cf7-wrapper .wpcf7-not-valid {
    border-color: #b91c1c;
}

#cf7-wrapper .wpcf7-not-valid-tip {
    display: block;
    margin-top: 0.375rem;
    color: #991b1b;
    font-size: 0.875rem;
}

.aira-pro-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.5rem;
    background: #2563eb;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.aira-support-header-link {
    display: inline-flex;
    min-height: 2.25rem;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid #f59e0b;
    border-radius: 0.75rem;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.aira-support-header-link:hover,
.aira-support-header-link-active {
    border-color: #d97706;
    background: #fef3c7;
    color: #78350f;
}

.aira-support-header-link:hover {
    transform: translateY(-1px);
}

.aira-support-header-link svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.aira-menu-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: #374151;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.aira-menu-link:hover,
.aira-menu-link-active {
    background: #eff6ff;
    color: #2563eb;
}

@media (forced-colors: active) {
    .aira-pro-badge,
    .aira-support-header-link,
    #cf7-wrapper input,
    #cf7-wrapper textarea {
        border: 1px solid ButtonText;
    }
}

@media (max-width: 520px) {
    .aira-support-header-link {
        width: 2.25rem;
        padding-inline: 0;
    }

    .aira-support-header-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}
