/*
 * form.cmleteam.com — campaign hub
 *
 * Page-scoped: pulled in by layouts/campaign.blade.php, never loaded on the
 * main site, so it is free to add its own primitives without touching
 * site.css. Built from the same design tokens as site.css (--bg, --card,
 * --accent, …). This domain deliberately skips the public site's fixed
 * nav-bar and footer (layouts/campaign.blade.php instead) — just the
 * wordmark, centered, so campaign pages read as their own focused space.
 */

/* Sits at the top of the sidebar card (campaign-sidebar), not on its own —
   see the comment there for why it moved off a standalone header bar. */
.campaign-top-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.campaign-top-logo { display: block; }
.campaign-top-logo img { height: 26px; width: auto; display: block; }

.campaign-hub-section {
    /* No overflow:hidden here on purpose — this section has no oversized
       blurred glow shapes to clip (unlike .hero), and clipping would also
       break the sidebar's position:sticky below, since sticky positioning
       stops working inside a clipped/scroll-affecting ancestor. The pattern
       layers don't need it either: inset:0 already bounds them exactly to
       this element's own box. */
    position: relative;
    padding: 64px 0 100px;
    min-height: 100vh;
}

/* Same convention as .section > .wrap in site.css: keeps real content above
   the pattern/gradient pseudo-elements below, since this isn't a .section.
   The pseudo-elements get an explicit z-index too, rather than relying on
   .wrap's stacking context alone to outrank an implicit "auto" — belt and
   braces, since this is exactly the layer that must never sit on top. */
.campaign-hub-section.section-pattern::before,
.campaign-hub-section.section-pattern::after {
    z-index: 0;
}

.campaign-hub-section > .wrap {
    position: relative;
    z-index: 1;
}

.campaign-hub {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 860px) {
    .campaign-hub { grid-template-columns: 1fr; }
}

/* ---------- sidebar ---------- */

.campaign-sidebar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    /* Same top padding as .campaign-main, so the logo and the "Kampanyalar"
       heading start at the same height as the main card's own content. */
    padding: 40px 20px;
    position: sticky;
    top: 24px;
}

@media (max-width: 860px) {
    .campaign-sidebar { position: static; }
}

.campaign-sidebar-title {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
}

.campaign-sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    border: 1px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.campaign-sidebar-link:hover { background: var(--card-hover); }

.campaign-sidebar-link.is-active {
    border-color: var(--border-hover);
    background: rgba(var(--accent-rgb), 0.1);
}

.campaign-sidebar-name {
    font-weight: 600;
    font-size: 14.5px;
    color: var(--text);
}

.campaign-badge {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 100px;
    white-space: nowrap;
}

.campaign-badge.is-open { color: #34D399; background: rgba(52, 211, 153, 0.12); }
.campaign-badge.is-closed { color: var(--muted); background: rgba(255, 255, 255, 0.06); }

.campaign-sidebar-empty { color: var(--muted); font-size: 14px; }

/* ---------- main column ---------- */

.campaign-main {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
}

@media (max-width: 560px) {
    .campaign-main { padding: 28px 20px; }
}

.campaign-main h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 12px; }
.campaign-main .lead { margin-bottom: 28px; }

.campaign-note {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14.5px;
    border: 1px solid;
}

.campaign-note.ok { color: #34D399; border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.campaign-note.error { color: #F87171; border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }

/* ---------- form ---------- */

.campaign-form { display: grid; gap: 20px; }

.form-row { display: grid; gap: 8px; }

.form-row label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-2);
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="date"],
.form-row input[type="url"],
.form-row textarea {
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}

.form-row input:focus,
.form-row textarea:focus { outline: none; border-color: var(--accent); }

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

/* The native picker's own button is drawn dark on a dark field and all but
   disappears. It only shows for a visitor with no JavaScript — the picker
   below replaces the whole control for everybody else — but that visitor
   still has to be able to find it. `invert` is the one hook a browser gives
   for this icon; its colour cannot be set. */
.form-row input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: .55;
    cursor: pointer;
}

.form-row input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* ---------- date picker ----------
   Built in datepicker.js because a native date panel is painted by the
   browser and the operating system and takes no styling at all: on this form
   it arrives as a light box with an invisible icon, and no rule reaches
   inside it. Everything below is that panel, rebuilt in the page's own
   colours. */

.dp { position: relative; display: block; }

/* The typed field is a form field like any other, so it takes the same rule
   as its siblings rather than a copy of it — one padding to change later. */
.form-row .dp-input { padding-right: 46px; }

.dp-open {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    transition: color .15s, background .15s;
}

.dp-open svg { width: 19px; height: 19px; }
.dp-open:hover { color: var(--text); background: rgba(var(--accent-rgb), .12); }

.dp-pop {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    left: 0;
    width: 302px;
    max-width: 100%;
    padding: 14px;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .5), 0 0 0 1px rgba(var(--accent-rgb), .06);
}

.dp-head {
    display: grid;
    grid-template-columns: 32px 1fr 1fr 32px;
    gap: 6px;
    align-items: center;
    margin-bottom: 12px;
}

.dp-nav {
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-2);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.dp-nav:hover { color: var(--text); background: rgba(var(--accent-rgb), .12); }

.dp-select {
    width: 100%;
    height: 32px;
    padding: 0 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-2);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    cursor: pointer;
}

.dp-select:focus { outline: none; border-color: var(--accent); }

/* The list a browser drops open is its own; only its colours can be asked
   for, and without this it inherits the page's dark text on dark ground. */
.dp-select option { background: var(--card); color: var(--text); }

.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.dp-weekday {
    display: grid;
    place-items: center;
    height: 28px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
}

.dp-day {
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    cursor: pointer;
    transition: background .12s, color .12s;
}

.dp-day:hover:not(:disabled) { background: rgba(var(--accent-rgb), .18); }

/* Days from the neighbouring months stay visible rather than blank: a grid
   with holes in it is harder to read than one that is dimmed. */
.dp-day.is-outside { color: var(--muted); }

/* Today is a ring, the chosen day is filled. Two different questions, so two
   different marks — one can be both at once. */
.dp-day.is-today { box-shadow: inset 0 0 0 1px var(--border-hover); }

.dp-day.is-selected {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.dp-day:disabled {
    color: rgba(var(--accent-rgb), .18);
    cursor: default;
}

.dp-foot {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.dp-action {
    flex: 1;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: transparent;
    color: var(--text-2);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}

.dp-action:hover:not(:disabled) {
    color: var(--text);
    border-color: var(--border-hover);
    background: rgba(var(--accent-rgb), .1);
}

.dp-action:disabled { opacity: .4; cursor: default; }

/* On a narrow screen the panel is the width of the field it belongs to, so
   it never hangs off the side of the page. */
@media (max-width: 420px) {
    .dp-pop { width: 100%; padding: 12px; }
    .dp-day { height: 38px; }
}

.field-error {
    color: #F87171;
    font-size: 13px;
}

/* A note under a field, in the muted colour so it reads as guidance rather
   than as something that went wrong — the error above it owns the loud one. */
.field-hint {
    color: var(--muted);
    font-size: 13px;
}

.hp-field { position: absolute; left: -9999px; }

/* ---------- consents ---------- */

.consent-list { display: grid; gap: 14px; padding: 18px 0; border-top: 1px solid var(--border); }

.consent-item { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }

/* Clicking anywhere here — the box or the text — opens the consent modal;
   it's the only trigger now, there's no separate "review" button. */
.consent-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14.5px;
    color: var(--text-2);
    flex: 1 1 240px;
    cursor: pointer;
}

.consent-check:hover { color: var(--text); }
.consent-check:hover span { text-decoration: underline; text-underline-offset: 3px; }

.consent-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    pointer-events: none;
}

.consent-check input[type="checkbox"]:disabled { opacity: 0.4; }

/* ---------- OTP step ---------- */

.otp-input {
    width: 100%;
    max-width: 260px;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--text);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 10px;
    text-align: center;
}

.otp-input:focus { outline: none; border-color: var(--accent); }

.resend-form { margin-top: 16px; }

/* ---------- consent modal (no Bootstrap on the public site) ---------- */

.consent-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.consent-modal[hidden] { display: none; }

.consent-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 3, 10, 0.72);
}

.consent-modal-dialog {
    position: relative;
    max-width: 1000px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius);
}

.consent-modal-head {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 18px 32px;
    border-bottom: 1px solid var(--border);
}

.consent-modal-head h3 { margin: 4px 0 0; color: var(--text); }

.consent-modal-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
}

/* The title stays and everything under it scrolls, the accept button
   included: it is the last line of the text, so it is reached by reading
   down to it rather than pressed from beside a page nobody looked at. The
   dialog used to scroll as a whole, which ran the bar across its rounded
   corners; the bar is now the roadmap rail's: thin, in the accent, on a faint
   track, inset from the edge. */
.consent-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin: 0 6px 6px 0;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-rgb), 0.45) transparent;
}

.consent-modal-body::-webkit-scrollbar { width: 6px; }
.consent-modal-body::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); border-radius: 100px; margin: 12px 0; }
.consent-modal-body::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), 0.45); border-radius: 100px; }
.consent-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-rgb), 0.7); }

.consent-modal-content {
    padding: 24px 26px 0 32px;
    color: var(--text-2);
    font-size: 15px;
    line-height: 1.7;
}

.consent-modal-footer {
    padding: 24px 26px 26px 32px;
    text-align: right;
}

@media (max-width: 560px) {
    .consent-modal-head { padding: 18px 16px 14px 20px; }
    .consent-modal-content { padding: 20px 14px 0 20px; }
    .consent-modal-footer { padding: 20px 14px 20px 20px; }
}

/* ---------- closed notice ---------- */

.campaign-closed { color: var(--text-2); }
.campaign-closed h2 { color: var(--text); margin-bottom: 12px; }
