/* ===================================================================
   The contact page (src/pages/contact.html). Shared building blocks are in style/pages.css; only this page's own parts go here.

   form ........ .ct-grid > .ct-card (.ct-form-view | .ct-done) + aside.ct-side (.ct-way cards)
   fields ...... .ct-topics (radio chips) .ct-field .ct-control .ct-icon .ct-error .ct-count .ct-trap (hidden from people)
   sent ........ .ct-done .ct-done-art (a paper plane flies off, a check is drawn: one go, nothing repeats)
   company ..... .ct-company > .ct-facts (registry data) + .ct-map-card (scripts/worldmap.js: messages fly in to Kraków)
   =================================================================== */

.ct-sec {
    position: relative;
}

.ct-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    align-items: start;
    gap: clamp(20px, 3vw, 36px);
    max-width: 1160px;
    margin-inline: auto;
}

/* ===== the form card ===== */

.ct-card {
    min-width: 0;
    padding: clamp(22px, 3.4vw, 40px);

    border: 1px solid var(--color-border-soft);
    border-radius: 24px;
    background: var(--color-bg);
    box-shadow: 0 30px 70px -40px rgba(5, 46, 22, .45), var(--shadow-sm);
}

:root[data-theme="dark"] .ct-card {
    border-color: var(--color-border);
    background: var(--color-bg-soft);
    box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .8);
}

.ct-title {
    font-size: clamp(24px, 2.4vw, 30px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.ct-sub {
    margin-top: 8px;
    font-size: 16px;
    line-height: 1.55;
    color: var(--color-text-soft);
}

.ct-form {
    display: grid;
    gap: 20px;
    margin-top: 26px;
}

.ct-label {
    display: block;
    margin-bottom: 8px;

    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
}

.ct-req {
    color: var(--color-text-quiet);
}

/* the topic: four radio buttons that look like the app's chips */
.ct-topics {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.ct-topic-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ct-topic {
    position: relative;
    cursor: pointer;
}

.ct-topic input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.ct-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    min-height: 40px;
    padding-inline: 14px 16px;

    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg);

    font-size: 14.5px;
    font-weight: 700;
    color: var(--color-text-soft);
    white-space: nowrap;

    transition: border-color .18s var(--ease), background-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}

.ct-chip svg {
    width: 17px;
    height: 17px;
    flex: none;
    color: var(--color-text-quiet);
    transition: color .18s var(--ease);
}

:root[data-theme="dark"] .ct-chip {
    background: var(--color-bg);
}

.ct-topic:hover .ct-chip {
    border-color: color-mix(in srgb, var(--color-green) 45%, var(--color-border));
    color: var(--color-text);
}

.ct-topic input:checked + .ct-chip {
    border-color: color-mix(in srgb, var(--color-green) 70%, var(--color-border));
    background: var(--color-green-soft);
    color: var(--color-text);
    box-shadow: 0 8px 18px -12px rgba(22, 163, 74, .7);
}

.ct-topic input:checked + .ct-chip svg {
    color: var(--green-text);
}

.ct-topic input:focus-visible + .ct-chip {
    outline: 2px solid var(--green-text);
    outline-offset: 2px;
}

:root[data-theme="dark"] .ct-topic input:focus-visible + .ct-chip {
    outline-color: var(--color-green);
}

/* name and e-mail side by side */
.ct-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ct-field {
    min-width: 0;
}

.ct-control {
    position: relative;
}

.ct-icon {
    position: absolute;
    inset-inline-start: 15px;
    top: 50%;
    transform: translateY(-50%);

    width: 19px;
    height: 19px;

    color: var(--color-text-quiet);
    pointer-events: none;
    transition: color .15s ease;
}

.ct-control:focus-within .ct-icon {
    color: var(--green-text);
}

.ct-control input,
.ct-control textarea {
    display: block;
    width: 100%;

    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg-soft);

    font: 500 15.5px/1.5 var(--font-sans);
    color: var(--color-text);

    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.ct-control input {
    height: 50px;
    padding-inline: 44px 14px;
}

.ct-control textarea {
    min-height: 168px;
    padding: 13px 15px;
    resize: vertical;
}

:root[data-theme="dark"] .ct-control input,
:root[data-theme="dark"] .ct-control textarea {
    background: var(--color-bg);
}

.ct-control :is(input, textarea)::placeholder {
    color: var(--color-text-quiet);
}

.ct-control :is(input, textarea):hover {
    border-color: color-mix(in srgb, var(--color-text-muted) 55%, var(--color-border));
}

.ct-control :is(input, textarea):focus {
    outline: none;
    border-color: var(--color-green);
    background: var(--color-bg);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-green) 20%, transparent);
}

.ct-under {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ct-error {
    display: none;
    margin-top: 6px;

    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #dc2626;
}

:root[data-theme="dark"] .ct-error {
    color: #f87171;
}

.ct-field.has-error .ct-error {
    display: block;
}

.ct-field.has-error :is(input, textarea) {
    border-color: #ef4444;
}

.ct-field.has-error :is(input, textarea):focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .2);
}

.ct-field.has-error .ct-icon {
    color: #ef4444;
}

.ct-count {
    flex: none;
    margin-top: 6px;
    margin-inline-start: auto;

    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-text-quiet);
    font-variant-numeric: tabular-nums;
}

.ct-count.is-near {
    color: #b45309;
}

:root[data-theme="dark"] .ct-count.is-near {
    color: #fbbf24;
}

/* the bot trap: out of sight and out of the tab order; screen readers skip it (aria-hidden) */
.ct-trap {
    position: absolute;
    inset-inline-start: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.ct-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 14px 16px;

    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fef2f2;
    color: #b91c1c;

    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
}

.ct-alert[hidden] {
    display: none;
}

.ct-alert svg {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.ct-alert a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

:root[data-theme="dark"] .ct-alert {
    border-color: rgba(239, 68, 68, .35);
    background: rgba(239, 68, 68, .1);
    color: #fca5a5;
}

/* the send button: the green of "Start Free" on the register page */
.ct-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 100%;
    height: 54px;

    border-radius: 12px;
    background: var(--color-green);
    color: var(--color-green-ink);

    font-size: 16.5px;
    font-weight: 800;

    box-shadow: 0 1px 2px rgba(22, 163, 74, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: background-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease), opacity .18s ease;
}

.ct-submit:hover {
    background: #2bd46a;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -14px rgba(22, 163, 74, .8), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.ct-submit:active {
    transform: translateY(0);
}

.ct-submit:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 3px;
}

.ct-submit-arrow {
    width: 18px;
    height: 18px;
    transition: transform .22s var(--ease);
}

.ct-submit:hover .ct-submit-arrow {
    transform: translateX(4px);
}

[dir="rtl"] .ct-submit-arrow {
    transform: scaleX(-1);
}

[dir="rtl"] .ct-submit:hover .ct-submit-arrow {
    transform: scaleX(-1) translateX(4px);
}

.ct-spinner {
    display: none;
    width: 20px;
    height: 20px;

    border: 2.5px solid color-mix(in srgb, var(--color-green-ink) 25%, transparent);
    border-top-color: var(--color-green-ink);
    border-radius: 50%;

    animation: ct-spin .7s linear infinite;
}

.ct-submit.is-loading {
    cursor: progress;
    opacity: .85;
    transform: none;
}

.ct-submit.is-loading .ct-spinner {
    display: block;
}

.ct-submit.is-loading .ct-submit-arrow {
    display: none;
}

@keyframes ct-spin {
    to { transform: rotate(360deg); }
}

.ct-note {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--color-text-soft);
}

.ct-note a {
    font-weight: 700;
    color: var(--green-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ===== sent: a paper plane leaves along a dashed line, then a check is drawn (one go) ===== */

.ct-done {
    padding-block: clamp(12px, 3vw, 36px);
    text-align: center;
}

.ct-done[hidden],
.ct-form-view[hidden] {
    display: none;
}

.ct-done .ct-title:focus {
    outline: none;
}

.ct-done-art {
    width: min(220px, 70%);
    margin: 0 auto 10px;
}

.ct-done-art svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.ct-done-trail {
    fill: none;
    stroke: color-mix(in srgb, var(--color-green) 55%, transparent);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-dasharray: 5 7;
    opacity: 0;
    animation: ct-trail 1.1s .15s var(--ease) forwards;
}

.ct-done-plane {
    offset-path: path("M18 96 C 52 92, 70 60, 98 46 S 140 26, 150 16");
    offset-rotate: auto;
    offset-distance: 0%;
    fill: var(--color-green);
    opacity: 0;
    animation: ct-fly 1.25s .1s cubic-bezier(.5, 0, .3, 1) forwards;
}

.ct-done-ring {
    fill: var(--color-green-soft);
    stroke: var(--color-green);
    stroke-width: 3;
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(.6);
    opacity: 0;
    animation: ct-pop .5s 1.05s var(--ease) forwards;
}

.ct-done-check {
    fill: none;
    stroke: var(--green-text);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 44;
    stroke-dashoffset: 44;
    animation: ct-draw .45s 1.35s var(--ease) forwards;
}

@keyframes ct-trail {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ct-fly {
    0% { offset-distance: 0%; opacity: 0; }
    12% { opacity: 1; }
    85% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

@keyframes ct-pop {
    to { transform: scale(1); opacity: 1; }
}

@keyframes ct-draw {
    to { stroke-dashoffset: 0; }
}

.ct-again {
    margin-top: 24px;
}

/* ===== other ways to reach us ===== */

.ct-side {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.ct-way {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 16px;
    padding: 20px;

    border: 1px solid var(--color-border-soft);
    border-radius: 20px;
    background: var(--color-bg);
    box-shadow: var(--shadow-sm);
}

:root[data-theme="dark"] .ct-way {
    border-color: var(--color-border);
    background: var(--color-bg-soft);
}

.ct-way h3 {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.3;
}

.ct-way p {
    margin-top: 4px;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--color-text-soft);
}

.ct-way .more-link {
    margin-top: 10px;
    font-size: 14.5px;
}

.ct-mail-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.ct-way .ct-mail-row {
    margin-top: 10px;
}

.ct-mail {
    font-size: 16px;
    font-weight: 800;
    color: var(--color-text);
    overflow-wrap: anywhere;
}

.ct-mail:hover {
    color: var(--green-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ct-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    height: 30px;
    padding-inline: 10px 12px;

    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);

    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-soft);

    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.ct-copy:hover {
    border-color: color-mix(in srgb, var(--color-green) 55%, var(--color-border));
    color: var(--color-text);
}

.ct-copy svg {
    width: 14px;
    height: 14px;
}

.ct-copy .ct-copy-ok,
.ct-copy.is-done .ct-copy-i {
    display: none;
}

.ct-copy.is-done .ct-copy-ok {
    display: block;
}

.ct-copy.is-done {
    border-color: transparent;
    background: var(--color-green);
    color: var(--color-green-ink);
}

/* ===== the company ===== */

.ct-company {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: center;
    gap: clamp(28px, 5vw, 72px);
    max-width: 1220px;
    margin-inline: auto;
}

.ct-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin-top: 28px;
    overflow: hidden;

    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: var(--color-border);
}

.ct-fact {
    min-width: 0;
    padding: 14px 18px;
    background: var(--color-bg);
}

:root[data-theme="dark"] .ct-fact {
    background: var(--color-bg-soft);
}

.ct-fact.is-wide {
    grid-column: 1 / -1;
}

.ct-fact dt {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--color-text-soft);
}

.ct-fact dd {
    margin-top: 3px;

    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.ct-fact dd a {
    color: var(--green-text);
}

.ct-fact dd a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* the map: Europe, Kraków marked; little messages fly in from cities (scripts/contact.js) */
.ct-map-card {
    position: relative;
    min-width: 0;
    margin: 0;
    padding: clamp(10px, 2vw, 18px);

    border: 1px solid var(--color-border-soft);
    border-radius: 24px;
    background: var(--color-bg);
    box-shadow: 0 30px 70px -44px rgba(5, 46, 22, .5), var(--shadow-sm);
}

:root[data-theme="dark"] .ct-map-card {
    border-color: var(--color-border);
    background: var(--color-bg);
    box-shadow: none;
}

.ct-map {
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    background: color-mix(in srgb, var(--color-green) 5%, var(--color-bg-soft));
}

:root[data-theme="dark"] .ct-map {
    background: var(--color-bg-soft);
}

.ct-map .ct-arc {
    fill: none;
    stroke: var(--color-green);
    stroke-linecap: round;
    stroke-dasharray: 2 5;
}

.ct-map .ct-msg {
    fill: var(--color-green);
    stroke: var(--map-dot-ring);
}

.ct-map .ct-home {
    fill: var(--color-green-dark);
    stroke: var(--map-dot-ring);
}

:root[data-theme="dark"] .ct-map .ct-home {
    fill: var(--color-green);
}

.ct-map .ct-ring {
    fill: none;
    stroke: var(--color-green);
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0;
}

/* a slow ring around Kraków: only while the map is in view (data-anim), never with reduced motion */
.ct-map .ct-ring.is-idle {
    animation: ct-ring 3.2s var(--ease) infinite;
}

.ct-map .ct-ring.is-idle.is-late {
    animation-delay: 1.6s;
}

@keyframes ct-ring {
    0% { transform: scale(.4); opacity: .75; }
    100% { transform: scale(2.4); opacity: 0; }
}

.ct-map .ct-from {
    fill: color-mix(in srgb, var(--color-text-soft) 55%, transparent);
}

.ct-map-cap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 8px 4px;

    font-size: 14.5px;
    line-height: 1.5;
    color: var(--color-text-soft);
}

.ct-map-cap strong {
    color: var(--color-text);
}

.ct-pin {
    flex: none;
    width: 12px;
    height: 12px;
    margin-top: 5px;

    border-radius: 50%;
    background: var(--color-green-dark);
    box-shadow: 0 0 0 4px var(--color-green-soft);
}

:root[data-theme="dark"] .ct-pin {
    background: var(--color-green);
}

/* ===== narrower screens ===== */

@media (max-width: 960px) {

    .ct-grid,
    .ct-company {
        grid-template-columns: minmax(0, 1fr);
        max-width: 680px;
    }

    .ct-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {

    .ct-row,
    .ct-side,
    .ct-facts {
        grid-template-columns: minmax(0, 1fr);
    }

    .ct-card {
        padding: 20px 18px 22px;
        border-radius: 20px;
    }

    .ct-chip {
        min-height: 38px;
        padding-inline: 12px 14px;
        font-size: 14px;
    }

    .ct-way {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 14px;
        padding: 18px 16px;
    }

    .ct-way .sec-icon {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .ct-map .ct-ring.is-idle,
    .ct-spinner {
        animation: none;
    }

    /* the sent picture is shown as it ends: the check, no flight */
    .ct-done-trail,
    .ct-done-plane {
        display: none;
    }

    .ct-done-ring {
        animation: none;
        transform: none;
        opacity: 1;
    }

    .ct-done-check {
        animation: none;
        stroke-dashoffset: 0;
    }
}
