/* KOSANO B2B - üye tarafı teması. Derleme gerektirmez; mobil öncelikli. Marka rengi: KSO lacivert #083A81. */
:root {
    --brand: #083a81;
    --brand-dark: #062c62;
    --brand-light: #e8eef8;
    --brand-mid: #2d5fa8;
    --accent: #c8102e;          /* yalnızca hata / silme gibi uyarı öğeleri için */
    --bg: #eef2f8;
    --card: #ffffff;
    --text: #1c2733;
    --muted: #64748b;
    --border: #cfd8e6;
    --ok: #166534;
    --ok-bg: #dcfce7;
    --err: #991b1b;
    --err-bg: #fee2e2;
    --warn-bg: #fef3c7;
    --warn: #78350f;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(8, 58, 129, 0.06), 0 8px 24px rgba(8, 58, 129, 0.07);
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    line-height: 1.55;
    background:
        radial-gradient(1200px 380px at 50% -120px, rgba(8, 58, 129, 0.10), transparent 70%),
        var(--bg);
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

/* ---------- Üst çubuk (giriş yapılmış / geniş sayfalar) ---------- */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(8, 58, 129, 0.05);
    position: relative;
}
.topbar::after {            /* ince marka şeridi */
    content: "";
    position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--brand-mid) 60%, var(--brand-light));
}
.topbar-inner {
    max-width: 1080px; margin: 0 auto; padding: 0.6rem 1rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.brand-logo { height: 42px; width: auto; display: block; }
.brand-sub {
    font-size: 0.8rem; font-weight: 600; color: var(--brand); letter-spacing: 0.02em;
    padding-left: 0.75rem; border-left: 2px solid var(--brand-light); line-height: 1.2;
}
.nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.nav a {
    color: var(--brand); text-decoration: none; font-size: 0.92rem; font-weight: 600;
    padding: 0.45rem 0.8rem; border-radius: 8px;
}
.nav a:hover { background: var(--brand-light); }
.nav form { margin: 0 0 0 0.35rem; }

/* ---------- Giriş ekranları: ortalanmış büyük logo ---------- */
.auth-hero { text-align: center; padding: 2.2rem 1rem 0.4rem; }
.auth-hero img { width: min(300px, 78vw); height: auto; display: inline-block; }
.auth-hero p {
    margin: 0.8rem 0 0; font-size: 0.95rem; font-weight: 600; color: var(--brand);
    letter-spacing: 0.06em; text-transform: uppercase;
}

/* ---------- Sayfa iskeleti ---------- */
.container { width: 100%; max-width: 520px; margin: 1.4rem auto; padding: 0 1rem; flex: 1 0 auto; }
.container.wide { max-width: 1080px; }
.container.auth { margin-top: 1rem; }

.site-footer {
    text-align: center; color: var(--muted); font-size: 0.8rem;
    padding: 1.2rem 1rem 1.6rem;
}
.site-footer strong { color: var(--brand); font-weight: 600; }

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(8, 58, 129, 0.06);
    margin-bottom: 1rem;
}
.card h1 { font-size: 1.3rem; margin: 0 0 1rem; color: var(--brand); letter-spacing: -0.01em; }
.card h2 {
    font-size: 1.05rem; margin: 1.6rem 0 0.85rem; color: var(--brand);
    padding-bottom: 0.4rem; border-bottom: 2px solid var(--brand-light);
}
.card h1 + h2, .card > h2:first-child { margin-top: 0; }

.alert { padding: 0.75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: 0.95rem; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: #86efac; }
.alert-error { background: var(--err-bg); color: var(--err); border-color: #fca5a5; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #fcd34d; }

/* ---------- Form ---------- */
.field { margin-bottom: 1rem; }
.field label.label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.92rem; color: #24334a; }
.field .req { color: var(--accent); }
.field .hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }
.field .error { font-size: 0.85rem; color: var(--err); margin-top: 0.3rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], textarea, select {
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 9px;
    font: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 0; }
input:hover, textarea:hover, select:hover { border-color: #b4c2d9; }
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(8, 58, 129, 0.16);
}
input.is-invalid, textarea.is-invalid { border-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 1.05rem; height: 1.05rem; }

.check { display: flex; gap: 0.55rem; align-items: flex-start; margin: 0.4rem 0; cursor: pointer; }
.check input { margin-top: 0.22rem; flex: none; }
.check.all { padding-bottom: 0.4rem; border-bottom: 1px dashed var(--border); margin-bottom: 0.55rem; }

fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 0.8rem 1rem 0.95rem; margin: 0 0 1rem; background: #fbfcfe; }
fieldset legend { font-weight: 700; padding: 0 0.45rem; color: var(--brand); font-size: 0.92rem; }
fieldset .other-input { margin-top: 0.45rem; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Düğmeler ---------- */
.btn {
    display: inline-block; border: 0; border-radius: 9px;
    padding: 0.72rem 1.3rem; font: inherit; font-weight: 700; letter-spacing: 0.01em;
    cursor: pointer; background: var(--brand); color: #fff; text-decoration: none; text-align: center;
    box-shadow: 0 2px 6px rgba(8, 58, 129, 0.25);
    transition: background .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:focus-visible { outline: 3px solid rgba(8, 58, 129, 0.35); outline-offset: 2px; }
.btn:disabled { background: #a9b6cc; cursor: not-allowed; box-shadow: none; }
.btn-block { width: 100%; padding: 0.85rem 1.3rem; font-size: 1rem; }
.btn-light {
    background: transparent; color: var(--brand); border: 1px solid var(--border); box-shadow: none;
    padding: 0.42rem 0.9rem; font-size: 0.9rem; font-weight: 600;
}
.btn-light:hover { background: var(--brand-light); color: var(--brand-dark); }
.btn-small { padding: 0.42rem 0.85rem; font-size: 0.9rem; }
.btn-danger { background: var(--accent); box-shadow: 0 2px 6px rgba(200, 16, 46, 0.25); }
.btn-danger:hover { background: #9d0c24; }

.links { margin-top: 1.1rem; display: grid; gap: 0.65rem; font-size: 0.95rem; }
.links a { display: block; padding: 0.7rem 0.9rem; border-radius: 9px; background: var(--brand-light); text-decoration: none; font-weight: 600; }
.links a:hover { background: #d7e2f4; }

/* ---------- Etkinlik listeleri ---------- */
.events { list-style: none; margin: 0; padding: 0; }
.events li { padding: 0.8rem 0.9rem; border-left: 4px solid var(--brand); background: #f8faff; border-radius: 8px; margin-bottom: 0.6rem; }
.events li:last-child { margin-bottom: 0; }
.events .name { font-weight: 700; color: var(--brand); }
.events .meta { font-size: 0.85rem; color: var(--muted); }
.empty { color: var(--muted); }

/* ---------- KVKK penceresi ---------- */
.modal { position: fixed; inset: 0; background: rgba(6, 30, 66, 0.6); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-box { background: #fff; border-radius: var(--radius); max-width: 720px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border); font-weight: 700; color: var(--brand); }
.modal-body { padding: 1.1rem; overflow-y: auto; }
.prose h1, .prose h2, .prose h3 { color: var(--brand); }
.prose ul, .prose ol { padding-left: 1.4rem; }

/* ---------- Görüşme ekranları ---------- */
.meta { font-size: 0.85rem; color: var(--muted); }
.name { font-weight: 600; }

.event-row, .meeting-row, .table-row {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: 0.9rem 0; border-top: 1px solid #e6ecf5; flex-wrap: wrap;
}
.event-row:first-of-type, .meeting-row:first-of-type { border-top: 0; }
.table-row { text-decoration: none; color: inherit; padding-left: 0.5rem; padding-right: 0.5rem; border-radius: 8px; }
.table-row:hover { background: var(--brand-light); }
.actions { display: flex; gap: 0.5rem; align-items: center; }
.actions form { margin: 0; }

.filter { margin-bottom: 1rem; max-width: 420px; }
.filter .label { display: block; font-weight: 600; margin-bottom: 0.25rem; }

.badge { display: inline-block; padding: 0.15rem 0.65rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.badge-free { background: var(--ok-bg); color: var(--ok); }
.badge-full { background: var(--err-bg); color: var(--err); }
.badge-off { background: #e5e7eb; color: #4b5563; }

.day-title { font-size: 1rem; margin: 1.3rem 0 0.55rem; color: var(--brand); font-weight: 700; }
.slots { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.slots form { margin: 0; }
.slot {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 118px; min-height: 46px; padding: 0.4rem 0.7rem; border-radius: 9px;
    border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 0.92rem; text-align: center;
}
.slot small { font-weight: 500; font-size: 0.72rem; }
.slot-free { background: var(--ok-bg); color: var(--ok); border-color: #86efac; cursor: pointer; transition: transform .05s, background .15s; }
button.slot-free:hover { background: #bbf7d0; }
button.slot-free:active { transform: scale(.98); }
.slot-taken { background: var(--err-bg); color: var(--err); border-color: #fca5a5; cursor: not-allowed; }
.slot-mine { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
.slot-closed, .slot-off { background: #e5e7eb; color: #6b7280; cursor: not-allowed; }
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 0.25rem; }
.legend .slot { min-width: 0; min-height: 0; padding: 0.15rem 0.65rem; font-size: 0.8rem; }

/* ---------- Telefon ---------- */
@media (max-width: 560px) {
    .brand-logo { height: 34px; }
    .brand-sub { display: none; }
    .topbar-inner { padding: 0.5rem 0.75rem; }
    .nav a { padding: 0.4rem 0.55rem; font-size: 0.88rem; }
    .card { padding: 1.1rem; border-radius: 10px; }
    .auth-hero { padding-top: 1.4rem; }
    /* Slotlar (bazıları form içinde) eşit genişlikte 3'lü satırlar oluştursun */
    .slots > form, .slots > .slot { flex: 1 1 calc(33.333% - 0.5rem); min-width: 0; }
    .slot { width: 100%; min-width: 0; padding-left: 0.3rem; padding-right: 0.3rem; font-size: 0.85rem; }
    .event-row .btn, .actions { width: 100%; }
    .event-row .btn { text-align: center; }
}

@media (max-width: 400px) {
    .slots > form, .slots > .slot { flex-basis: calc(50% - 0.5rem); }
}
