/* Başvuru, panel ve metin sayfaları. Ana sayfayla aynı dil: açık zemin, beyaz kartlar, seçimlerde mavi. */
:root {
    --bg: #f5f5f7;
    --card: #fff;
    --ink: #1d1d1f;
    --ink-2: #6e6e73;
    --ink-3: #86868b;
    --line: rgba(0, 0, 0, 0.1);
    --line-soft: rgba(0, 0, 0, 0.06);
    --fill: #f2f2f4;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-soft: rgba(0, 113, 227, 0.1);
    --danger: #d70015;
    --success: #248a3d;
    --warning: #b25000;
    --radius: 18px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
    color-scheme: light;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.47;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: -0.015em;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Üst çubuk ---------------------------------------------------------------------------- */

.bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 52px;
    padding: 0 max(20px, env(safe-area-inset-left));
    background: rgba(245, 245, 247, 0.82);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line-soft);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
}

.brand:hover {
    text-decoration: none;
}

.brand img {
    display: block;
    height: 20px;
    width: auto;
}

.me {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
}

.me[hidden] {
    display: none;
}

.bar-link {
    color: var(--ink-2);
}

.bar-link:hover {
    color: var(--ink);
    text-decoration: none;
}

.who {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--fill);
    object-fit: cover;
}

@media (max-width: 520px) {
    .who-name {
        display: none;
    }
}

/* --- Sayfa ve kartlar ----------------------------------------------------------------------- */

.page {
    padding: 40px 20px 24px;
}

.narrow {
    max-width: 720px;
    margin: 0 auto;
}

.loading,
.empty {
    margin: 48px 0;
    text-align: center;
    color: var(--ink-3);
    font-size: 15px;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 16px;
}

.meta {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--ink-3);
}

.foot {
    padding: 8px 20px 40px;
    text-align: center;
    font-size: 13px;
}

.foot a {
    color: var(--ink-3);
}

/* --- Düğmeler ----------------------------------------------------------------------------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 22px;
    border: 0;
    border-radius: 980px;
    background: var(--fill);
    color: var(--ink);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s var(--ease), transform 0.2s var(--ease), opacity 0.2s;
}

.button:hover {
    background: #e8e8ed;
    text-decoration: none;
}

.button:active {
    transform: scale(0.98);
}

.button:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
}

.button.primary {
    background: var(--accent);
    color: #fff;
}

.button.primary:hover {
    background: var(--accent-hover);
}

.button.danger {
    background: transparent;
    color: var(--danger);
    box-shadow: inset 0 0 0 1px rgba(215, 0, 21, 0.35);
}

.button.danger:hover {
    background: rgba(215, 0, 21, 0.06);
}

.button.wide {
    width: 100%;
    min-height: 50px;
    font-size: 17px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.quiet {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font-size: 14px;
    cursor: pointer;
}

.quiet:hover {
    text-decoration: underline;
}

.quiet-row {
    margin: 24px 0 0;
    text-align: center;
}

.quiet-row .quiet {
    color: var(--ink-3);
    font-size: 13px;
}

/* --- Durum ekranı --------------------------------------------------------------------------- */

.status {
    padding: 48px 32px;
    text-align: center;
}

.status h1 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.15;
}

.status > p {
    max-width: 30em;
    margin: 12px auto 0;
    color: var(--ink-2);
}

.status-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
    border-radius: 50%;
    background: var(--fill);
    color: var(--ink-2);
}

.status-icon svg {
    width: 26px;
    height: 26px;
}

.status.approved .status-icon,
.status.whitelisted .status-icon {
    background: rgba(36, 138, 61, 0.12);
    color: var(--success);
}

.status.interview .status-icon {
    background: var(--accent-soft);
    color: var(--accent);
}

.status.rejected .status-icon {
    background: rgba(215, 0, 21, 0.08);
    color: var(--danger);
}

.staff-note {
    max-width: 30em;
    margin: 24px auto 0;
    padding: 16px 18px;
    border-radius: 14px;
    background: var(--fill);
    text-align: left;
}

.staff-note span {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.staff-note p {
    margin: 4px 0 0;
    white-space: pre-wrap;
}

/* --- Şehre bağlan ------------------------------------------------------------------------- */

.connect-mark {
    display: block;
    width: 64px;
    height: auto;
    margin: 0 auto 24px;
}

.button.large {
    min-height: 52px;
    padding: 0 30px;
    font-size: 17px;
}

.tips h2 {
    font-size: 17px;
    font-weight: 600;
}

.tips p {
    margin: 8px 0 0;
    color: var(--ink-2);
    font-size: 15px;
}

/* --- Form --------------------------------------------------------------------------------- */

.form-head {
    padding: 8px 4px 24px;
}

.form-head h1 {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-bottom: 16px;
}

.form-head p {
    margin: 0 0 10px;
    color: var(--ink-2);
    font-size: 16px;
}

.q h2 {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
}

.q-number {
    margin-right: 10px;
    color: var(--ink-3);
    font-size: 15px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.optional {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 400;
    color: var(--ink-3);
    white-space: nowrap;
}

.help {
    margin: 10px 0 0;
    color: var(--ink-2);
    font-size: 15px;
}

.q > .choices,
.q > .scale,
.q > .grid,
.q > .select,
.q > .text {
    margin-top: 18px;
}

.field-error,
.form-error {
    margin: 10px 0 0;
    color: var(--danger);
    font-size: 14px;
}

.field-error:empty,
.form-error:empty {
    display: none;
}

.q.has-error {
    box-shadow: inset 0 0 0 1.5px rgba(215, 0, 21, 0.45);
}

.notice {
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(178, 80, 0, 0.08);
    color: var(--warning);
    font-size: 15px;
}

/* Seçimler: gizli girdi + hap biçimli etiket */
.choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.choice {
    position: relative;
}

.choice input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.choice span {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 12px;
    background: var(--fill);
    font-size: 15px;
    line-height: 1.3;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.choice span:hover {
    background: #e8e8ed;
}

.choice input:checked + span {
    background: var(--accent);
    color: #fff;
}

.choice input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* 1-10 ölçeği */
.scale {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
}

.scale .choice span {
    justify-content: center;
    width: 100%;
    padding: 8px 0;
    font-variant-numeric: tabular-nums;
}

.scale-end {
    grid-row: 2;
    font-size: 12px;
    color: var(--ink-3);
}

.scale-end.start {
    grid-column: 1 / span 3;
}

.scale-end.end {
    grid-column: 8 / span 3;
    text-align: right;
}

@media (max-width: 520px) {
    .scale {
        grid-template-columns: repeat(5, 1fr);
    }

    .scale-end {
        grid-row: 3;
    }

    .scale-end.start {
        grid-column: 1 / span 2;
    }

    .scale-end.end {
        grid-column: 4 / span 2;
    }
}

/* Satır satır seçim (terimler, saatler) */
.grid-row + .grid-row {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
}

.grid-label {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
}

.select select {
    width: 100%;
    min-height: 46px;
    padding: 0 40px 0 14px;
    border: 0;
    border-radius: 12px;
    background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2386868b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center;
    font-size: 16px;
    appearance: none;
    cursor: pointer;
}

.text textarea {
    display: block;
    width: 100%;
    min-height: 180px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--fill);
    font-size: 16px;
    line-height: 1.55;
    resize: none;
    overflow: hidden;
    transition: border-color 0.15s, background-color 0.15s;
}

.text textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
}

.text-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.counter {
    font-size: 12px;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

.submit .check {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 15px;
    cursor: pointer;
}

.check input {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.submit .meta {
    text-align: center;
}

/* --- Metin sayfası (aydınlatma metni) ---------------------------------------------------------- */

.legal h1 {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
}

.legal h2 {
    margin: 32px 0 8px;
    font-size: 19px;
    font-weight: 600;
}

.legal p,
.legal li {
    color: #333336;
    font-size: 16px;
}

.legal ul {
    padding-left: 20px;
}

.legal li + li {
    margin-top: 6px;
}

/* --- Yetkili paneli ------------------------------------------------------------------------- */

.panel-page {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 380px 1fr;
}

.panel-list {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 24px 16px 0;
    border-right: 1px solid var(--line-soft);
}

.panel-list h1 {
    padding: 0 8px;
    font-size: 28px;
    font-weight: 700;
}

.tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    margin: 16px 0 12px;
    padding: 2px;
    border-radius: 10px;
    background: #e8e8ed;
}

.tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.tab.active {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.count {
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
}

.list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 24px;
}

.row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 8px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.row:hover {
    background: rgba(0, 0, 0, 0.04);
}

.row.active {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.row .avatar {
    width: 40px;
    height: 40px;
    flex: none;
}

.row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.row-name {
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-sub {
    margin: 0;
    overflow: hidden;
    color: var(--ink-3);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-time {
    flex: none;
    color: var(--ink-3);
    font-size: 12px;
}

.panel-detail {
    min-height: 0;
    overflow-y: auto;
    padding: 32px clamp(20px, 4vw, 56px) 48px;
}

.back {
    display: none;
}

.detail-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.detail-head h2 {
    font-size: 24px;
    font-weight: 700;
}

.detail-head > div {
    flex: 1;
    min-width: 0;
}

.avatar.large {
    width: 56px;
    height: 56px;
}

.quiet.inline {
    font-size: 13px;
}

.badge {
    flex: none;
    padding: 4px 10px;
    border-radius: 980px;
    background: var(--fill);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
}

.badge.interview {
    background: var(--accent-soft);
    color: var(--accent);
}

.badge.approved {
    background: rgba(36, 138, 61, 0.12);
    color: var(--success);
}

.badge.rejected {
    background: rgba(215, 0, 21, 0.08);
    color: var(--danger);
}

.answer {
    margin-top: 16px;
    padding: 20px 22px;
    border-radius: 16px;
    background: var(--card);
}

.answer h3 {
    margin-bottom: 6px;
    color: var(--ink-3);
    font-size: 13px;
    font-weight: 600;
}

.answer p {
    margin: 0;
    font-size: 16px;
}

.answer .long {
    white-space: pre-wrap;
    line-height: 1.6;
}

.answer .muted {
    color: var(--ink-3);
}

.pairs {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pairs li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 15px;
}

.pairs li + li {
    margin-top: 6px;
}

.pairs span {
    color: var(--ink-2);
}

.events {
    margin-top: 28px;
}

.events h3 {
    margin-bottom: 8px;
    font-size: 15px;
}

.events p {
    margin: 6px 0 0;
    color: var(--ink-2);
    font-size: 14px;
}

.event-note {
    display: block;
    margin-top: 2px;
    color: var(--ink);
    white-space: pre-wrap;
}

.decision {
    position: sticky;
    bottom: -48px;
    margin: 28px -8px 0;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.decision .note {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--fill);
    font-size: 15px;
    resize: vertical;
}

.decision .note:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
}

.decision .actions {
    justify-content: flex-end;
    margin-top: 12px;
}

@media (max-width: 820px) {
    .panel {
        grid-template-columns: 1fr;
    }

    .panel-list {
        border-right: 0;
    }

    .panel-detail {
        display: none;
        padding-top: 16px;
    }

    .show-detail .panel-list {
        display: none;
    }

    .show-detail .panel-detail {
        display: block;
    }

    .back {
        display: inline-block;
        margin-bottom: 16px;
        padding: 0;
        border: 0;
        background: none;
        color: var(--accent);
        font-size: 16px;
        cursor: pointer;
    }

    .decision .actions .button {
        flex: 1;
    }
}

/* --- Bildirim ------------------------------------------------------------------------------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    z-index: 20;
    padding: 12px 20px;
    border-radius: 980px;
    background: rgba(29, 29, 31, 0.92);
    color: #fff;
    font-size: 15px;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
    pointer-events: none;
}

.toast.on {
    opacity: 1;
    transform: translate(-50%, 0);
}
