/* COREMAIL tasarım sistemi — temel katman (tokenlar, yazı tipleri, temel bileşenler) */

/* ---------------------------------------------------------------- yazı tipleri (yerel barındırma) */
@font-face { font-family: "Geist"; src: url("../fonts/geist-latin.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+20AC, U+2122, U+FEFF; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+FEFF; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-ext.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+FEFF; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-ext-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }

/* ---------------------------------------------------------------- tokenlar */
:root {
    --paper: #F6F4EF;
    --bg: #FAFAF9;
    --surface: #FFFFFF;
    --surface-2: #F5F5F4;
    --surface-3: #EEEDEA;
    --hover: #F3F2EF;
    --border: #E7E5E4;
    --border-strong: #D6D3D1;
    --text: #1C1917;
    --text-2: #44403C;
    --muted: #78716C;
    --faint: #A8A29E;
    --ink: #1C1917;
    --ink-hover: #2E2925;
    --on-ink: #FAFAF9;
    --accent: #F05A28;
    --accent-hover: #DC4A1B;
    --accent-text: #C2410C;
    --accent-soft: #FFF1EA;
    --accent-line: #FBD5C5;
    --ok: #15803D;
    --ok-soft: #EEFBF2;
    --ok-line: #C9EED5;
    --warn: #B45309;
    --warn-soft: #FFF8EB;
    --warn-line: #FBE3B3;
    --danger: #DC2626;
    --danger-soft: #FEF3F2;
    --danger-line: #FBD0CC;
    --info: #1D4ED8;
    --info-soft: #EFF4FF;
    --focus: 0 0 0 3px rgba(240, 90, 40, .22);
    --radius-lg: 14px;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow-sm: 0 1px 2px rgba(28, 25, 23, .05);
    --shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 2px 8px rgba(28, 25, 23, .04);
    --shadow-pop: 0 16px 48px -12px rgba(28, 25, 23, .22), 0 0 0 1px rgba(28, 25, 23, .06);
    --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
    --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --ease: cubic-bezier(.2, .7, .2, 1);
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #12100E;
        --bg: #0E0C0B;
        --surface: #171412;
        --surface-2: #1D1A17;
        --surface-3: #262220;
        --hover: #211E1B;
        --border: #2A2623;
        --border-strong: #3A3531;
        --text: #F5F4F2;
        --text-2: #D6D3D1;
        --muted: #A29B95;
        --faint: #6F6862;
        --ink: #F5F4F2;
        --ink-hover: #FFFFFF;
        --on-ink: #171412;
        --accent: #FF6A3D;
        --accent-hover: #FF7F57;
        --accent-text: #FF8A63;
        --accent-soft: #2A1910;
        --accent-line: #4A2817;
        --ok: #4ADE80; --ok-soft: #102017; --ok-line: #1D3A28;
        --warn: #FBBF24; --warn-soft: #231B0B; --warn-line: #3E2F12;
        --danger: #F87171; --danger-soft: #261212; --danger-line: #452020;
        --info: #93B4FF; --info-soft: #121A2E;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow: 0 1px 2px rgba(0, 0, 0, .35);
        --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
        color-scheme: dark;
    }
}

/* ---------------------------------------------------------------- temel */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body {
    font: 400 14.5px/1.55 var(--font); color: var(--text); background: var(--bg);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "ss01", "cv11"; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
.ic { display: inline-block; flex: none; vertical-align: -3px; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: -.012em; line-height: 1.2; }
p { margin: 0 0 1em; }
small { font-size: .86em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
code, kbd, .mono { font-family: var(--mono); font-size: .88em; font-feature-settings: normal; }
code { padding: 1px 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
::selection { background: var(--accent-soft); color: var(--text); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.accent-text { color: var(--accent-text); }
.warn-text { color: var(--warn); }

/* ---------------------------------------------------------------- düğmeler */
.btn {
    --h: 36px;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: var(--h); padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font: 500 13.5px/1 var(--font); letter-spacing: -.005em; cursor: pointer; white-space: nowrap; user-select: none;
    color: var(--text); background: var(--surface); text-decoration: none;
    transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .1s var(--ease), box-shadow .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn.is-loading { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--on-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 1px 2px rgba(28, 25, 23, .2); }
.btn-primary:hover:not(:disabled) { background: var(--ink-hover); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(194, 65, 12, .3); }
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { border-color: var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); border-color: var(--border-strong); }
.btn-quiet { background: transparent; color: var(--text-2); }
.btn-quiet:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.95); }
.btn-danger-ghost { border-color: var(--border); background: var(--surface); color: var(--danger); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger-line); }
.btn-sm { --h: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn-lg { --h: 44px; padding: 0 20px; font-size: 15px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn.is-loading::before {
    content: ""; width: 13px; height: 13px; border-radius: 50%;
    border: 1.75px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.linklike { background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; font: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.link { color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; transition: text-decoration-color .15s; }
.link:hover { text-decoration-color: var(--accent); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.back-link:hover { color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- formlar */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend, .label { font-weight: 500; font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field small, .hint { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.hint { margin: -6px 0 0; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], input[type=datetime-local], input[type=time], input[type=url], input[type=tel], input:not([type]), select, textarea {
    width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font: 400 14px/1.4 var(--font); box-shadow: var(--shadow-sm);
    transition: border-color .15s, box-shadow .15s; appearance: none;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.55; }
select {
    padding-right: 32px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input:disabled, input[readonly] { background: var(--surface-2); color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; cursor: pointer; line-height: 1.45; color: var(--text-2); }
.check input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--ink); flex: none; cursor: pointer; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.addr-input { display: flex; align-items: stretch; height: 38px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.addr-input:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.addr-input input, .addr-input select { height: 100%; border: 0; border-radius: 0; box-shadow: none !important; }
.addr-input input { flex: 1 1 50%; min-width: 0; font-family: var(--mono); font-size: 13.5px; }
.addr-input select { flex: 1 1 50%; min-width: 0; background-color: var(--surface-2); border-left: 1px solid var(--border); font-family: var(--mono); font-size: 13.5px; }
.addr-input > span { display: flex; align-items: center; padding: 0 2px 0 4px; color: var(--faint); font-family: var(--mono); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }

/* ---------------------------------------------------------------- uyarılar */
.alert {
    display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius);
    margin-bottom: 16px; border: 1px solid; font-size: 13.5px; line-height: 1.5; animation: rise .25s var(--ease);
}
.alert > span { flex: 1; padding-top: 1px; }
.alert .ic { margin-top: 1px; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.alert-info { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.alert-close { background: none; border: 0; color: inherit; cursor: pointer; opacity: .6; padding: 2px; display: flex; border-radius: 4px; }
.alert-close:hover { opacity: 1; }
@keyframes rise { from { opacity: 0; transform: translateY(-4px); } }

/* ---------------------------------------------------------------- rozetler */
.badge {
    display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px;
    font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; line-height: 1;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.no-dot::before, .badge:has(.ic)::before { display: none; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge-muted { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; margin: 2px 3px 2px 0; border-radius: 6px; font: 500 11.5px/1 var(--mono); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.chip-admin { background: var(--ink); color: var(--on-ink); border-color: var(--ink); font-family: var(--font); }
.chip-api { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }
.chip-user { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip-system { color: var(--muted); }
.method { display: inline-flex; align-items: center; justify-content: center; min-width: 54px; height: 22px; font: 600 11px/1 var(--mono); border-radius: 5px; letter-spacing: .02em; }
.method-get { background: var(--ok-soft); color: var(--ok); }
.method-post { background: var(--info-soft); color: var(--info); }
.method-patch { background: var(--warn-soft); color: var(--warn); }
.method-delete { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------- marka */
.brand { display: inline-flex; align-items: center; gap: 9px; font: 650 17px/1 var(--font); letter-spacing: -.03em; color: var(--text); text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand b { font-weight: 700; }
.brand i { font-style: normal; font-weight: 400; color: var(--muted); }

/* ---------------------------------------------------------------- demo şeridi */
.demo-bar {
    display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
    min-height: 32px; padding: 6px 16px; background: #1C1917; color: #D6D3D1; font-size: 12.5px; text-align: center;
    position: relative; z-index: 50;
}
.demo-bar strong { display: inline-flex; align-items: center; gap: 7px; color: #fff; font-weight: 600; letter-spacing: .02em; }
.demo-bar strong::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #F05A28; box-shadow: 0 0 0 3px rgba(240, 90, 40, .25); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(240, 90, 40, 0); } }

/* ---------------------------------------------------------------- bildirimler */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: calc(100vw - 36px); }
.toast {
    display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius);
    background: #1C1917; color: #F5F4F2; box-shadow: var(--shadow-pop); font-size: 13.5px; max-width: 420px;
    animation: toast-in .3s var(--ease); line-height: 1.45;
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #A8A29E; margin-top: 6px; flex: none; }
.toast.success::before { background: #4ADE80; }
.toast.error::before { background: #F87171; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 560px) {
    .field-row { grid-template-columns: 1fr; }
}
