:root {
    --ac-ink: #16181d;
    --ac-text: #3d424c;
    --ac-muted: #8b909c;
    --ac-line: #e4e6eb;
    --ac-primary: #ff7a45;
    --ac-primary-from: #ff8d5d;
    --ac-primary-to: #e85d28;
    --ac-ring: rgba(255, 122, 69, 0.28);
    --ac-accent: #ff7a45;
    --ac-accent-ink: #c2410c;
    --ac-canvas: #ece8fb;
    --ac-field: rgba(255, 255, 255, 0.88);
    --ac-danger: #d6363c;
    --ac-font: "Outfit", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    --ac-soft: #fff4ed;
    --ac-media: #1c1420;
}

*, *::before, *::after { box-sizing: border-box; }

body.login-page,
body.welcome-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--ac-font);
    color: var(--ac-ink);
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(900px 600px at 0% 0%, color-mix(in srgb, #d8d0f5 80%, transparent), transparent 70%),
        linear-gradient(162deg, #f6f7fb 0%, var(--ac-canvas) 42%, color-mix(in srgb, #d8d0f5 55%, var(--ac-canvas)) 70%, color-mix(in srgb, var(--ac-accent) 28%, var(--ac-canvas)) 100%) fixed;
}

.ac-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
}

/* ---------- Card ---------- */
.ac-card {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 600px;
    display: grid;
    grid-template-columns: minmax(400px, 0.8fr) 1.2fr;
    gap: 16px;
    padding: 16px;
}

.ac-pane,
.ac-media {
    animation: ac-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ac-media { animation-delay: 0.08s; }

@keyframes ac-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Left pane ---------- */
.ac-pane {
    min-height: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: clamp(14px, 2vh, 26px) clamp(18px, 2.4vw, 40px) clamp(10px, 1.6vh, 20px);
}

.ac-pane-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ac-brand {
    display: inline-flex;
    align-items: center;
    padding: 9px 20px;
    border: 1px solid color-mix(in srgb, var(--ac-text) 38%, transparent);
    border-radius: 999px;
    color: var(--ac-ink);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.ac-brand span { color: var(--ac-accent-ink); font-weight: 700; }
.ac-brand:hover { background: rgba(255, 255, 255, 0.6); border-color: color-mix(in srgb, var(--ac-text) 60%, transparent); }

.ac-lang { position: relative; }
.ac-lang summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid var(--ac-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.ac-lang summary::-webkit-details-marker { display: none; }
.ac-lang-caret { font-size: 10px; transition: transform 0.2s ease; }
.ac-lang[open] .ac-lang-caret { transform: rotate(180deg); }
.ac-lang ul {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
    min-width: 160px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--ac-ink) 45%, transparent);
}
.ac-lang a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 11px;
    color: var(--ac-ink);
    font-size: 13.5px;
    text-decoration: none;
}
.ac-lang a:hover { background: #f6f7fb; }
.ac-lang a.is-active { font-weight: 600; }
.ac-lang a .bi { color: var(--ac-primary); }

.ac-pane-body {
    align-self: center;
    justify-self: center;
    width: min(400px, 100%);
    padding: 12px 0;
}

.ac-title {
    margin: 0;
    text-align: center;
    font-size: clamp(26px, 2.2vw, 32px);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.ac-sub {
    margin: 8px 0 0;
    text-align: center;
    color: var(--ac-muted);
    font-size: 13.5px;
    line-height: 1.5;
}

.ac-flash {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 0;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(46, 160, 98, 0.12);
    color: #1f7a4a;
    font-size: 13px;
}

/* ---------- Form ---------- */
.ac-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.ac-field { display: block; }

.ac-label {
    display: block;
    margin: 0 0 7px 16px;
    color: var(--ac-muted);
    font-size: 12.5px;
    font-weight: 500;
}
.ac-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 4px 7px 16px;
}
.ac-label-row .ac-label { margin: 0; }
.ac-forgot {
    font-size: 12.5px;
    white-space: nowrap;
}

.ac-input {
    position: relative;
    display: block;
}

.ac-input input {
    width: 100%;
    height: 50px;
    padding: 0 48px 0 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--ac-field);
    color: var(--ac-ink);
    font: 500 14.5px var(--ac-font);
    outline: none;
    box-shadow: inset 0 1px 2px color-mix(in srgb, var(--ac-media) 5%, transparent);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.ac-input input::placeholder { color: var(--ac-muted); font-weight: 400; }
.ac-input input:hover { background: rgba(255, 255, 255, 0.92); }
.ac-input input:focus {
    background: #fff;
    border-color: var(--ac-primary);
    box-shadow: 0 0 0 4px var(--ac-ring);
}
.ac-input input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 40px #f6f7fb inset;
    -webkit-text-fill-color: var(--ac-ink);
}

.ac-input-icon,
.ac-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: var(--ac-muted);
    font-size: 16px;
}
.ac-input-icon { pointer-events: none; }
.ac-eye {
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.ac-eye:hover { background: color-mix(in srgb, var(--ac-text) 8%, transparent); color: var(--ac-primary); }

.ac-field.has-error input,
.ac-input input.is-error {
    border-color: var(--ac-danger);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(214, 54, 60, 0.12);
}

.ac-field .fa-error {
    margin: 7px 0 0 16px;
    color: var(--ac-danger);
    font-size: 12.5px;
}
.ac-field .fa-error[hidden],
.ac-caps[hidden] { display: none; }

.ac-caps {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 7px 0 0 16px;
    color: #a36a00;
    font-size: 12.5px;
}

.ac-options {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 2px 6px 0;
    font-size: 13px;
}

.ac-remember {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ac-text);
    cursor: pointer;
}
.ac-remember input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.ac-check {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 1.5px solid color-mix(in srgb, var(--ac-text) 30%, transparent);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.7);
    color: transparent;
    font-size: 15px;
    transition: all 0.15s ease;
}
.ac-remember input:checked + .ac-check {
    border-color: var(--ac-primary);
    background: var(--ac-primary);
    color: #fff;
}
.ac-remember input:focus-visible + .ac-check { box-shadow: 0 0 0 4px var(--ac-ring); }

.ac-link {
    color: var(--ac-ink);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--ac-text) 35%, transparent);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}
.ac-link:hover { color: var(--ac-primary); text-decoration-color: var(--ac-primary); }

.ac-submit {
    position: relative;
    width: 100%;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(145deg, var(--ac-primary-from), var(--ac-primary-to));
    color: #fff;
    font: 600 15.5px var(--ac-font);
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--ac-text) 85%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.ac-submit:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 18px 30px -14px color-mix(in srgb, var(--ac-text) 90%, transparent); }
.ac-submit:active { transform: translateY(0); }
.ac-submit:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ac-ring); }
.ac-submit:disabled { cursor: progress; opacity: 0.85; }
.ac-submit .bi { font-size: 17px; color: var(--ac-accent); transition: transform 0.2s ease; }
.ac-submit:hover .bi { transform: translateX(3px); }

.ac-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ac-spin 0.7s linear infinite;
}
.ac-submit.is-loading .ac-spinner { display: inline-block; }
@keyframes ac-spin { to { transform: rotate(360deg); } }

.ac-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 2px 0 0;
    color: var(--ac-muted);
    font-size: 12.5px;
}
.ac-secure .bi { color: var(--ac-accent-ink); }

.ac-pane-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--ac-muted);
    font-size: 12.5px;
}
.ac-pane-foot .ac-link { font-size: 12.5px; }
.ac-pane-foot .ac-link .bi { font-size: 12px; }

/* ---------- Welcome hero ---------- */
.ac-hero { width: min(430px, 100%); text-align: center; }
.ac-hero .ac-cta { max-width: 360px; }

.ac-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.65);
    color: var(--ac-text);
    font-size: 13px;
    font-weight: 500;
}

.ac-pulse {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ac-muted);
}
.ac-pulse::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--ac-muted) 50%, transparent);
    animation: ac-ping 1.8s ease-out infinite;
}
@keyframes ac-ping {
    from { transform: scale(0.6); opacity: 1; }
    to { transform: scale(1.6); opacity: 0; }
}

.ac-hero-brand {
    margin: 16px 0 0;
    font-size: clamp(46px, 4.6vw, 62px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.035em;
}
.ac-hero-brand span {
    background: linear-gradient(135deg, var(--ac-accent), var(--ac-accent-ink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.ac-hero .ac-sub { margin-top: 14px; font-size: 15px; }

.ac-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 26px 0 28px;
    padding: 0;
    list-style: none;
}
.ac-features li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    color: var(--ac-text);
    font-size: 13px;
    font-weight: 500;
}
.ac-features .bi { color: var(--ac-primary); }

.ac-enter {
    margin: 12px 0 0;
    color: var(--ac-muted);
    font-size: 12.5px;
}
.ac-enter kbd {
    padding: 2px 7px;
    border: 1px solid var(--ac-line);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.7);
    font: 600 11px var(--ac-font);
}

/* ---------- Media pane ---------- */
.ac-media {
    position: relative;
    min-height: 0;
    overflow: hidden;
    border-radius: 32px;
    background: var(--ac-media);
    box-shadow: 0 30px 60px -36px color-mix(in srgb, var(--ac-ink) 70%, transparent);
    isolation: isolate;
}

.ac-media-slides,
.ac-media-slide,
.ac-media-shade {
    position: absolute;
    inset: 0;
}
.ac-media-slide {
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.06);
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), transform 7s ease-out;
}
.ac-media-slide.is-on { opacity: 1; transform: scale(1); }
.ac-media-shade {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--ac-ink) 22%, transparent) 0%, transparent 28%, transparent 60%, color-mix(in srgb, var(--ac-ink) 42%, transparent) 100%);
}

.ac-float {
    position: absolute;
    z-index: 2;
    animation: ac-bob 6s ease-in-out infinite alternate;
}
@keyframes ac-bob {
    from { transform: translateY(0); }
    to { transform: translateY(-6px); }
}

.ac-task { top: 5%; left: 8%; width: 220px; animation-delay: -1s; }
.ac-task-card {
    position: relative;
    z-index: 1;
    padding: 11px 30px 11px 14px;
    border-radius: 12px;
    background: var(--ac-accent);
    color: var(--ac-ink);
    box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.55);
}
.ac-task-card strong { display: block; font-size: 13px; font-weight: 600; }
.ac-task-card span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--ac-text); }
.ac-task-dot {
    position: absolute;
    top: 11px;
    right: 12px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ac-ink);
}
.ac-task-sub {
    position: relative;
    margin: -6px 0 0 26px;
    padding: 14px 30px 9px 14px;
    border-radius: 0 0 12px 12px;
    background: color-mix(in srgb, var(--ac-media) 80%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.82);
    font-size: 11.5px;
}
.ac-task-sub i {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 7px;
    height: 7px;
    margin-top: -1px;
    border-radius: 50%;
    background: var(--ac-accent);
}

.ac-face {
    display: block;
    border-radius: 50%;
    background-color: var(--ac-soft);
    background-repeat: no-repeat;
    background-size: 700% auto;
    background-position: var(--fx) var(--fy);
    border: 3px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.6);
}

.ac-faces { top: 36%; right: 6%; width: 128px; height: 116px; animation-delay: -3s; }
.ac-faces .ac-face { position: absolute; }
.ac-face.is-lg { width: 66px; height: 66px; left: 0; top: 0; }
.ac-face.is-md { width: 56px; height: 56px; left: 64px; top: 20px; }
.ac-face.is-sm { width: 46px; height: 46px; left: 26px; top: 64px; }

.ac-week {
    left: 18%;
    bottom: 31%;
    width: min(370px, 62%);
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 10px 10px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    color: #fff;
    text-align: center;
    animation-delay: -2s;
}
.ac-week-day { padding: 5px 0 6px; border-radius: 10px; }
.ac-week-day small { display: block; font-size: 11px; opacity: 0.85; }
.ac-week-day b { display: block; margin-top: 2px; font-size: 19px; font-weight: 400; }
.ac-week-day.is-today {
    background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.34) 0 2px, rgba(255, 255, 255, 0.08) 2px 7px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.ac-week-day.is-today b { font-weight: 600; color: var(--ac-accent); }

.ac-meet {
    left: 11%;
    bottom: 12%;
    width: 200px;
    padding: 12px 14px 12px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.6);
    animation-delay: -4s;
}
.ac-meet-head { position: relative; }
.ac-meet-head strong { color: var(--ac-ink); font-size: 13px; font-weight: 600; }
.ac-meet-head .ac-task-dot { top: 4px; right: 0; background: var(--ac-accent); }
.ac-meet > span { display: block; margin-top: 3px; color: var(--ac-muted); font-size: 11.5px; }
.ac-meet-people { display: flex; margin-top: 12px; padding-left: 4px; }
.ac-face.is-xs {
    width: 24px;
    height: 24px;
    margin-left: -6px;
    border-width: 2px;
    box-shadow: none;
}

.ac-media-dots {
    position: absolute;
    right: 22px;
    bottom: 20px;
    z-index: 3;
    display: flex;
    gap: 6px;
}
.ac-media-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: width 0.3s ease, background 0.3s ease;
}
.ac-media-dot.is-on { width: 24px; background: var(--ac-accent); }

/* ---------- Responsive ---------- */
@media (min-width: 1600px) {
    .ac-card { grid-template-columns: minmax(480px, 0.75fr) 1.25fr; gap: 20px; padding: 20px; }
    .ac-pane-body { width: 400px; }
    .ac-hero { width: 460px; }
    .ac-task { width: 240px; }
    .ac-week { width: min(420px, 55%); }
    .ac-meet { width: 220px; }
}

@media (max-width: 1100px) {
    .ac-card { grid-template-columns: minmax(360px, 1fr) 1fr; }
    .ac-week { left: 8%; width: 84%; }
    .ac-faces { top: 30%; }
}

@media (max-width: 860px) {
    .ac-card {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100dvh;
    }
    .ac-media { display: none; }
    .ac-pane { padding: 10px 8px 6px; }
}

@media (max-width: 480px) {
    .ac-card { padding: 14px; }
    .ac-pane-foot { flex-direction: column-reverse; gap: 6px; }
}

@media (min-width: 861px) and (max-height: 640px) {
    .ac-card { height: auto; }
    .ac-media { min-height: 560px; }
}

@media (prefers-reduced-motion: reduce) {
    .ac-pane, .ac-media, .ac-float, .ac-pulse::after { animation: none; }
    .ac-media-slide { transition: opacity 0.4s ease; transform: none; }
}

.ac-card.is-single {
    grid-template-columns: 1fr;
    width: min(520px, 100%);
    height: auto;
    min-height: 100dvh;
    margin: 0 auto;
}

.login-method {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--ac-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
}
.login-method button {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ac-muted);
    font: 500 13px var(--ac-font);
    cursor: pointer;
}
.login-method button[aria-selected="true"] {
    background: var(--ac-primary);
    color: #fff;
    box-shadow: 0 8px 16px -10px var(--ac-primary);
}
.login-method button .bi { font-size: 14px; }

.ac-input input.login-passcode {
    letter-spacing: 0.28em;
    font-variant-numeric: tabular-nums;
}

.ac-flash.is-error {
    background: rgba(214, 54, 60, 0.1);
    color: var(--ac-danger);
}

.ac-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 4px;
    border: 0;
    background: transparent;
    color: var(--ac-text);
    font: 500 13px var(--ac-font);
    cursor: pointer;
    text-decoration: none;
}
.ac-switch:hover { color: var(--ac-primary); }

.fp-dev-hint, .fp-rule {
    margin: 0;
    color: var(--ac-muted);
    font-size: 12.5px;
    text-align: center;
}
.fp-dev-hint { color: #a36a00; }
.fp-actions {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}
