/* ==========================================================
   AILABONLINE - Site styles
   File: public/assets/css/style.css
   Theme: Yellow & Grey
   ========================================================== */

:root {
    --ail-yellow: #F5C400;
    --ail-yellow-dark: #D8AB00;
    --ail-dark: #34383D;
    --ail-dark-deep: #2A2D31;
    --ail-grey: #62676D;
    --ail-light: #F3F4F5;
    --ail-white: #FFFFFF;
    --ail-line: #DADCDF;

    --ail-font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
    --ail-font-body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;

    --ail-radius: 6px;
}

/* ---------- Base ---------- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 76px; /* keeps section titles clear of the fixed navbar */
}

body {
    font-family: var(--ail-font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ail-dark);
    background: var(--ail-white);
}

h1, h2, h3 {
    font-family: var(--ail-font-display);
    color: var(--ail-dark);
    letter-spacing: -0.01em;
}

a { color: var(--ail-dark); }

:focus-visible {
    outline: 3px solid var(--ail-yellow);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 2000;
    padding: .6rem 1rem;
    background: var(--ail-yellow);
    color: var(--ail-dark);
    font-weight: 600;
    border-radius: var(--ail-radius);
    transition: top .15s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
    font-weight: 600;
    border-radius: var(--ail-radius);
}

.btn-ail {
    background: var(--ail-yellow);
    border: 2px solid var(--ail-yellow);
    color: var(--ail-dark);
}
.btn-ail:hover,
.btn-ail:focus-visible {
    background: var(--ail-yellow-dark);
    border-color: var(--ail-yellow-dark);
    color: var(--ail-dark);
}

.btn-ail-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, .55);
    color: var(--ail-white);
}
.btn-ail-outline:hover,
.btn-ail-outline:focus-visible {
    background: var(--ail-white);
    border-color: var(--ail-white);
    color: var(--ail-dark);
}

.btn-ail-dark {
    background: var(--ail-dark);
    border: 2px solid var(--ail-dark);
    color: var(--ail-white);
}
.btn-ail-dark:hover,
.btn-ail-dark:focus-visible {
    background: var(--ail-yellow);
    border-color: var(--ail-yellow);
    color: var(--ail-dark);
}

/* ---------- Navigation ---------- */
.ail-nav {
    background: var(--ail-dark);
    padding-top: .75rem;
    padding-bottom: .75rem;
    transition: box-shadow .2s ease, padding .2s ease;
}
.ail-nav.is-scrolled {
    box-shadow: 0 2px 14px rgba(0, 0, 0, .3);
    padding-top: .45rem;
    padding-bottom: .45rem;
}

.ail-brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--ail-font-display);
    font-weight: 800;
    letter-spacing: .02em;
    color: var(--ail-white);
}

.ail-brand-mark {
    width: 1.15rem;
    height: 1.15rem;
    background: var(--ail-yellow);
    border-radius: 3px;
    box-shadow: .35rem .35rem 0 -.05rem var(--ail-grey);
    margin-right: .25rem;
}

.ail-nav .nav-link {
    color: rgba(255, 255, 255, .82);
    font-weight: 500;
    padding: .5rem .85rem;
}
.ail-nav .nav-link:hover,
.ail-nav .nav-link.active {
    color: var(--ail-yellow);
}

/* ---------- Hero ---------- */
.ail-hero {
    background: var(--ail-dark);
    color: var(--ail-white);
    padding: 8.5rem 0 5.5rem;
    overflow: hidden;
}

.ail-hero-title {
    color: var(--ail-white);
    font-weight: 800;
    font-size: clamp(2.4rem, 5.2vw, 4rem);
    line-height: 1.05;
    margin-bottom: 1.25rem;
}

.ail-hero-lead {
    max-width: 34rem;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, .8);
    margin-bottom: 2rem;
}

.ail-hero-note {
    margin: 1.25rem 0 0;
    font-size: .95rem;
    color: rgba(255, 255, 255, .62);
}

/* Circuit drawing */
.ail-circuit {
    display: block;
    width: 100%;
    max-width: 520px;
    height: auto;
    margin-inline: auto;
}

.ail-circuit .trace {
    fill: none;
    stroke: var(--ail-grey);
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: ail-draw 1.4s cubic-bezier(.5, 0, .2, 1) var(--d, 0s) forwards;
}
.ail-circuit .trace.hot { stroke: var(--ail-yellow); }

.ail-circuit .node {
    fill: var(--ail-yellow);
    opacity: 0;
    animation: ail-pop .35s ease var(--d, 1.2s) forwards;
}

.ail-circuit .chip {
    fill: var(--ail-dark-deep);
    stroke: var(--ail-yellow);
    stroke-width: 3;
}
.ail-circuit .chip-core {
    fill: var(--ail-dark);
    stroke: var(--ail-grey);
    stroke-width: 2;
}
.ail-circuit .chip-label {
    fill: var(--ail-yellow);
    font-family: var(--ail-font-display);
    font-weight: 800;
    font-size: 34px;
}

@keyframes ail-draw { to { stroke-dashoffset: 0; } }
@keyframes ail-pop  { to { opacity: 1; } }

/* ---------- Sections ---------- */
.ail-section {
    padding: 5.5rem 0;
}
.ail-section-light { background: var(--ail-light); }

.ail-section-head {
    max-width: 38rem;
    margin-bottom: 2.75rem;
}
.ail-section h2 {
    font-weight: 800;
    font-size: clamp(1.8rem, 3.4vw, 2.5rem);
    margin-bottom: .75rem;
}
.ail-section-head p {
    color: var(--ail-grey);
    margin: 0;
}

/* ---------- Lab panels ---------- */
.ail-lab {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: var(--ail-white);
    border: 1px solid var(--ail-line);
    border-top: 5px solid var(--ail-yellow);
    border-radius: var(--ail-radius);
    padding: 2.25rem 2rem 2rem;
}

.ail-lab-icon {
    color: var(--ail-dark);
    margin-bottom: 1.25rem;
}

.ail-lab h3 {
    font-weight: 800;
    font-size: 1.75rem;
    margin-bottom: .6rem;
}

.ail-lab p { color: var(--ail-grey); }

.ail-lab-status {
    margin-bottom: 1.75rem;
    font-size: .95rem;
}
.ail-lab .btn { margin-top: auto; }

/* ---------- Steps ---------- */
.ail-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ail-steps li {
    position: relative;
}
.ail-steps h3 {
    font-weight: 700;
    font-size: 1.3rem;
    margin: 1rem 0 .4rem;
}
.ail-steps p {
    color: var(--ail-grey);
    margin: 0;
    max-width: 22rem;
}

.ail-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background: var(--ail-yellow);
    color: var(--ail-dark);
    font-family: var(--ail-font-display);
    font-weight: 800;
    font-size: 1.15rem;
}

/* Line linking the steps on wide screens */
@media (min-width: 768px) {
    .ail-steps li:not(:last-child)::after {
        content: "";
        position: absolute;
        top: 1.3rem;
        left: 3.4rem;
        right: -.5rem;
        height: 2px;
        background: var(--ail-line);
    }
}

/* ---------- About ---------- */
.ail-about-lead {
    color: var(--ail-grey);
    max-width: 30rem;
}

.ail-audience { margin: 0; }
.ail-audience-row {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 1rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--ail-line);
}
.ail-audience-row:last-child { border-bottom: 1px solid var(--ail-line); }
.ail-audience dt {
    font-family: var(--ail-font-display);
    font-weight: 700;
    font-size: 1.15rem;
}
.ail-audience dd {
    margin: 0;
    color: var(--ail-grey);
}

@media (max-width: 575.98px) {
    .ail-audience-row { grid-template-columns: 1fr; gap: .25rem; }
}

/* ---------- Footer ---------- */
.ail-footer {
    background: var(--ail-dark);
    color: rgba(255, 255, 255, .72);
    padding: 2.5rem 0;
    font-size: .95rem;
}
.ail-footer strong { color: var(--ail-white); font-family: var(--ail-font-display); }
.ail-footer a {
    color: rgba(255, 255, 255, .85);
    text-decoration: none;
}
.ail-footer a:hover { color: var(--ail-yellow); text-decoration: underline; }

/* ---------- Mobile ---------- */
@media (max-width: 991.98px) {
    .ail-hero { padding-top: 7.5rem; }
    .ail-nav .navbar-collapse { padding: .75rem 0 1rem; }
}

@media (max-width: 575.98px) {
    .ail-section { padding: 4rem 0; }
    .ail-lab { padding: 1.75rem 1.5rem; }
}

/* ---------- Account pages (register / login) ---------- */
.ail-auth {
    background: var(--ail-light);
    min-height: 100vh;
    padding: 7.5rem 0 4rem;
}

.ail-auth-card {
    max-width: 520px;
    margin-inline: auto;
    background: var(--ail-white);
    border: 1px solid var(--ail-line);
    border-top: 5px solid var(--ail-yellow);
    border-radius: var(--ail-radius);
    padding: 2.25rem 2rem;
}

.ail-auth-card h1 {
    font-weight: 800;
    font-size: 1.9rem;
    margin-bottom: .35rem;
}

.ail-auth-sub {
    color: var(--ail-grey);
    margin-bottom: 1.75rem;
}

.ail-auth-foot {
    margin: 1.5rem 0 0;
    text-align: center;
    color: var(--ail-grey);
    font-size: .98rem;
}

.ail-auth .form-label { font-weight: 600; }

.ail-auth .form-control:focus,
.ail-auth .form-select:focus,
.ail-auth .form-check-input:focus {
    border-color: var(--ail-yellow-dark);
    box-shadow: 0 0 0 .2rem rgba(245, 196, 0, .35);
}

.ail-auth .form-check-input:checked {
    background-color: var(--ail-dark);
    border-color: var(--ail-dark);
}

.ail-auth .form-text { color: var(--ail-grey); }
.ail-auth .form-text.text-danger  { color: #B02A37 !important; }
.ail-auth .form-text.text-success { color: #146C43 !important; }

.btn-ail-field {
    background: var(--ail-white);
    border: 1px solid #CED4DA;
    color: var(--ail-dark);
    min-width: 4.5rem;
}
.btn-ail-field:hover,
.btn-ail-field:focus-visible {
    background: var(--ail-light);
    color: var(--ail-dark);
}

/* Honeypot field: hidden from people, visible to simple bots */
.ail-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 575.98px) {
    .ail-auth { padding-top: 6.5rem; }
    .ail-auth-card { padding: 1.75rem 1.4rem; }
}

/* ---------- Dashboard (temporary placeholder) ---------- */
.ail-nav-user {
    color: rgba(255, 255, 255, .82);
    font-weight: 500;
}

.ail-dash-card { max-width: 640px; }

.ail-dash-facts { margin: 0 0 1.5rem; }
.ail-dash-facts > div {
    display: grid;
    grid-template-columns: 6rem 1fr;
    gap: 1rem;
    padding: .8rem 0;
    border-top: 1px solid var(--ail-line);
}
.ail-dash-facts > div:last-child { border-bottom: 1px solid var(--ail-line); }
.ail-dash-facts dt { font-weight: 600; }
.ail-dash-facts dd { margin: 0; color: var(--ail-grey); word-break: break-word; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .ail-circuit .trace { animation: none; stroke-dashoffset: 0; }
    .ail-circuit .node { animation: none; opacity: 1; }
    .ail-nav, .skip-link { transition: none; }
}