/*
 * Pixron Mail PRO – Pixron Enterprise design layer.
 * Loaded after app.css: same tokens and type as the Pixron panel (Farro, navy + amber,
 * Otomatik/Gündüz/Gece). Remove this file to get the previous look back.
 */

@font-face { font-family: 'Farro'; font-style: normal; font-display: swap; font-weight: 400; src: url('../fonts/farro/farro-latin-400-normal.woff2') format('woff2'); 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: 'Farro'; font-style: normal; font-display: swap; font-weight: 400; src: url('../fonts/farro/farro-latin-ext-400-normal.woff2') format('woff2'); 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: 'Farro'; font-style: normal; font-display: swap; font-weight: 500; src: url('../fonts/farro/farro-latin-500-normal.woff2') format('woff2'); 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: 'Farro'; font-style: normal; font-display: swap; font-weight: 500; src: url('../fonts/farro/farro-latin-ext-500-normal.woff2') format('woff2'); 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: 'Farro'; font-style: normal; font-display: swap; font-weight: 700; src: url('../fonts/farro/farro-latin-700-normal.woff2') format('woff2'); 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: 'Farro'; font-style: normal; font-display: swap; font-weight: 700; src: url('../fonts/farro/farro-latin-ext-700-normal.woff2') format('woff2'); 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; }

/* ---------------------------------------------------------------- tokens */

:root,
[data-theme="pixron-light"] {
    --bg-color: #f4f6f9;
    --bg-subtle: #eef1f5;
    --card-bg: #ffffff;
    --text-main: #0f1729;
    --text-muted: #5b6577;
    --text-light: #8a94a6;
    --primary: #f5a524;
    --primary-hover: #e39612;
    --primary-ink: #1a1203;
    --primary-light: rgba(245, 165, 36, 0.14);
    --sidebar-bg: #0b1220;
    --sidebar-text: #eef2f8;
    --sidebar-text-muted: #94a0b4;
    --border-color: #e2e6ec;
    --focus-ring: 0 0 0 3px rgba(245, 165, 36, 0.35);
    --shadow-sm: 0 1px 2px rgba(15, 23, 41, 0.06);
    --shadow-md: 0 6px 18px -8px rgba(15, 23, 41, 0.18);
    --shadow-lg: 0 24px 60px -24px rgba(15, 23, 41, 0.35);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
    --theme-swatch-1: #f5a524;
    --theme-swatch-2: #0b1220;
    color-scheme: light;
}

[data-theme="pixron-dark"] {
    --bg-color: #070b14;
    --bg-subtle: #0f1626;
    --card-bg: #0d1424;
    --text-main: #f3f5f9;
    --text-muted: #a3adbf;
    --text-light: #6f7b90;
    --primary: #f5a524;
    --primary-hover: #f7b544;
    --primary-light: rgba(245, 165, 36, 0.16);
    --sidebar-bg: #050810;
    --sidebar-text: #eef2f8;
    --sidebar-text-muted: #8c97aa;
    --border-color: #1e293b;
    --shadow-md: 0 6px 18px -8px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
    --theme-swatch-1: #f5a524;
    --theme-swatch-2: #070b14;
    color-scheme: dark;
}

/* ---------------------------------------------------------------- base */

body,
button,
input,
select,
textarea {
    font-family: 'Farro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
body { font-size: 15px; line-height: 1.5; height: 100dvh; }
h1, h2, h3, h4, h5, h6 { font-family: 'Farro', sans-serif; font-weight: 700; letter-spacing: -0.01em; }

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-light) 45%, transparent); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

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

.sidebar { background: var(--sidebar-bg); border-right: 1px solid rgba(255, 255, 255, 0.06); }
.btn-compose {
    border-radius: 999px;
    background: var(--primary);
    color: var(--primary-ink, #1a1203);
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: 0 10px 24px -12px rgba(245, 165, 36, 0.8);
}
.btn-compose:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-compose:active { transform: scale(0.98); }
.sidebar-section-header { font-size: 12px; letter-spacing: 0.08em; }
.folder-item { border-radius: 10px; font-size: 14.5px; min-height: 40px; }
.folder-item:hover { background: rgba(255, 255, 255, 0.06); }
.folder-item.active { background: rgba(245, 165, 36, 0.14); color: #ffd28a; box-shadow: inset 3px 0 0 var(--primary); }
.folder-badge { background: var(--primary); color: #1a1203; font-weight: 700; }

/* ---------------------------------------------------------------- list */

.list-pane { background: var(--card-bg); border-right: 1px solid var(--border-color); }
.list-pane-title { font-size: 18px; }
.search-input { border-radius: 12px; background: var(--bg-subtle); border: 1px solid transparent; font-size: 14.5px; }
.search-input:focus { background: var(--card-bg); border-color: var(--primary); box-shadow: var(--focus-ring); }
.list-tab { font-size: 13.5px; font-weight: 500; }
.list-tab.active { color: var(--text-main); box-shadow: inset 0 -2px 0 var(--primary); }

.email-item {
    grid-template-columns: auto auto 36px 1fr auto;
    gap: 10px;
    padding: 12px 16px;
}
.email-item:hover { box-shadow: none; }
.email-item.active { background: var(--primary-light); box-shadow: inset 3px 0 0 var(--primary); }
.email-item.unread::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-radius: 999px;
    background: var(--primary);
}
.email-item-avatar {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--avatar-bg, #334155);
    flex-shrink: 0;
}
.email-item-sender { font-size: 14.5px; color: var(--text-main); }
.email-item-subject { font-size: 13.5px; color: var(--text-muted); }
.email-item.unread .email-item-sender { font-weight: 700; }
.email-item.unread .email-item-subject { color: var(--text-main); font-weight: 500; }
.email-item-meta { font-size: 12.5px; color: var(--text-light); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- reader */

.reader-pane { background: var(--bg-color); }
.reader-subject { font-size: 22px; line-height: 1.3; letter-spacing: -0.015em; text-wrap: balance; }
.reader-sender-avatar { border-radius: 12px; }
.reader-header { background: var(--card-bg); border-bottom: 1px solid var(--border-color); }
.reader-body-container { background: var(--card-bg); }
.btn-action { border-radius: 10px; font-weight: 500; }
.attachment-card { border-radius: 12px; }

/* ---------------------------------------------------------------- forms, buttons, dialogs */

.btn-primary,
.btn-send {
    border-radius: 999px;
    background: var(--primary);
    color: var(--primary-ink, #1a1203);
    font-weight: 700;
}
.btn-primary:hover,
.btn-send:hover { background: var(--primary-hover); }
.btn-primary:active,
.btn-send:active { transform: scale(0.98); }
.btn-secondary { border-radius: 999px; }
.form-control,
.settings-form-control { border-radius: 10px; font-size: 15px; }
.form-control:focus,
.settings-form-control:focus { border-color: var(--primary); box-shadow: var(--focus-ring); outline: none; }
.modal-card,
.settings-modal-card,
.compose-widget { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.toast { border-radius: 12px; font-weight: 500; }

/* ---------------------------------------------------------------- live status */

.sync-status.is-live .sync-status-dot { background: #22c55e; animation: px-live-pulse 2s infinite; }
@keyframes px-live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ---------------------------------------------------------------- login */

.px-login {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 72px 16px 24px;
    background: var(--bg-color);
    color: var(--text-main);
    position: relative;
}
body.px-login-body { height: auto; overflow: auto; }
.px-login-theme { position: absolute; top: 16px; right: 16px; }
.px-login-card {
    width: 100%;
    max-width: 920px;
    display: grid;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
}
@media (min-width: 900px) { .px-login-card { grid-template-columns: 5fr 6fr; } }
.px-login-brand { background: #0b1220; color: #cdd5e1; padding: 36px; display: flex; flex-direction: column; gap: 14px; order: 2; }
@media (min-width: 900px) { .px-login-brand { order: 1; padding: 44px; } }
.px-login-brand img { height: 36px; width: auto; align-self: flex-start; }
.px-login-brand h2 { margin-top: 16px; color: #fff; font-size: 24px; line-height: 1.25; }
.px-login-points { list-style: none; display: grid; gap: 14px; margin-top: 8px; font-size: 14px; }
.px-login-points li { display: flex; gap: 12px; }
.px-login-points .material-icons { color: var(--primary); font-size: 20px; margin-top: 1px; }
.px-login-points b { display: block; color: #fff; font-size: 15px; }
.px-login-form { padding: 36px; order: 1; }
@media (min-width: 640px) { .px-login-form { padding: 48px; } }
@media (min-width: 900px) { .px-login-form { order: 2; } }
.px-login-form h1 { font-size: 26px; }
.px-login-form .px-sub { margin-top: 4px; color: var(--text-muted); font-size: 15px; }
.px-login-form form { margin-top: 24px; display: grid; gap: 18px; }
.px-login-form label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 700; color: var(--text-main); }
.px-login-form .form-control { height: 48px; width: 100%; padding: 0 14px; font-size: 16px; background: var(--card-bg); color: var(--text-main); border: 1px solid var(--border-color); }
.px-login-form .btn-primary { height: 48px; width: 100%; font-size: 16px; border: 0; cursor: pointer; }
.px-login-pw { position: relative; }
.px-login-pw .form-control { padding-right: 48px; }
.px-login-eye { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--text-muted); border-radius: 10px; cursor: pointer; }
.px-login-error { margin-top: 18px; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; font-size: 15px; }
[data-theme="pixron-dark"] .px-login-error { border-color: #7f1d1d; background: rgba(127, 29, 29, 0.25); color: #fecaca; }
.px-login-help { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border-color); font-size: 14px; color: var(--text-muted); }
.px-login-help a { color: #a35f00; font-weight: 700; }
[data-theme="pixron-dark"] .px-login-help a { color: var(--primary); }
.px-login-app { margin-top: 14px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 12px; color: inherit; text-decoration: none; transition: background-color .15s, border-color .15s; }
.px-login-app:hover { border-color: #f5a524; background: rgba(245, 165, 36, .06); }
.px-login-app svg { flex: none; color: #a35f00; }
[data-theme="pixron-dark"] .px-login-app svg { color: var(--primary); }
.px-login-app span { display: flex; flex-direction: column; line-height: 1.35; font-size: 14px; }
.px-login-app small { color: var(--text-muted); font-size: 13px; }
.px-login-foot { margin-top: 18px; font-size: 13px; color: var(--text-muted); }

/* Otomatik / Gündüz / Gece switch (login + sidebar) */
.px-theme { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--card-bg); }
.px-theme button { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; background: none; color: var(--text-muted); cursor: pointer; }
.px-theme button .material-icons { font-size: 18px; }
.px-theme button:hover { color: var(--text-main); }
.px-theme button[aria-checked="true"] { background: #0b1220; color: #fff; }
[data-theme="pixron-dark"] .px-theme button[aria-checked="true"] { background: var(--primary); color: #1a1203; }

/* ---------------------------------------------------------------- surfaces follow the theme
 * app.css hard-codes white / slate-50 on these, which stayed light in night mode. */

.reader-body-container,
.attachment-card,
.btn-pagination,
.compose-widget,
.compose-widget-body-container,
.btn-attach-trigger,
.shortcuts-panel-card,
.email-list-empty,
.btn-secondary,
.settings-modal-card,
.settings-modal-body,
.settings-tab.active,
.settings-form-control,
.settings-form-control:focus,
.settings-signature-editor,
.account-settings-card,
.settings-list-panel,
.list-item-card,
.thread-conversation,
.thread-conversation-toolbar,
.form-control:focus {
    background-color: var(--card-bg);
    color: var(--text-main);
}

.form-control,
.checkmark,
.pagination-container,
.reader-empty,
.reader-sender-avatar,
.reader-attachments-section,
.btn-download,
.composer-toolbar,
.compose-attachment-badge,
.compose-widget-footer,
kbd,
.btn-secondary:hover,
.settings-nav,
.settings-section-desc kbd {
    background-color: var(--bg-subtle);
    color: var(--text-main);
}

.settings-nav-item { color: var(--text-muted); }
.attachment-name { color: var(--text-main); }
.attachment-size { color: var(--text-muted); }
/* The message itself stays on white: senders design HTML mail for a light page. */
.email-iframe { background-color: #ffffff; border-radius: 12px; }

/* ---------------------------------------------------------------- context menus */

.context-menu { min-width: 240px; border-radius: 14px; padding: 6px; }
.context-menu-item { border-radius: 9px; font-size: 14px; min-height: 36px; }
.context-menu-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.context-menu-item[disabled] { opacity: 0.45; pointer-events: none; }
.context-menu-title {
    padding: 8px 12px 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-light);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}
.context-menu-divider { margin: 4px 6px; }
/* Right-clicking a folder should open our menu, not select its label. */
.folder-item,
.email-item,
.list-tab { -webkit-user-select: none; user-select: none; }

/* ---------------------------------------------------------------- phone layout (≤ 768px) */

.px-nav-btn,
.px-reader-back,
.px-scrim { display: none; }

@media (max-width: 768px) {
    .workspace-container { display: block; }
    .panel-resizer,
    .panel-resizer-sidebar,
    .panel-resizer-list,
    .btn-sidebar-toggle { display: none !important; }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(84vw, 320px) !important;
        padding: 20px;
        z-index: 60;
        transform: translateX(-105%);
        transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    body.px-nav-open .sidebar { transform: none; }
    body.px-nav-open .px-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(5, 8, 16, 0.55); }

    .main-panel { height: 100dvh; }
    .list-pane { width: 100% !important; }
    .reader-pane { display: none; }
    body.px-reading .reader-pane {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 50;
        padding-top: 56px;
        background: var(--bg-color);
    }
    body.px-reading .px-reader-back {
        display: inline-flex;
        position: fixed;
        top: 8px;
        left: 8px;
        z-index: 52;
        height: 40px;
        padding: 0 14px 0 10px;
        gap: 6px;
        align-items: center;
        border-radius: 999px;
        border: 1px solid var(--border-color);
        background: var(--card-bg);
        color: var(--text-main);
        font-weight: 700;
        font-size: 15px;
        box-shadow: var(--shadow-md);
    }

    .px-nav-btn {
        display: inline-flex;
        width: 40px;
        height: 40px;
        margin-left: -8px;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 10px;
        background: none;
        color: var(--text-main);
    }

    .email-item { grid-template-columns: auto 36px 1fr auto; padding: 12px 14px 12px 16px; }
    .email-checkbox-wrapper,
    .email-item-actions,
    .email-item:hover .email-item-actions { display: none !important; }
    .email-item:hover .email-item-meta { display: flex; }
    .list-tabs { overflow-x: auto; }
    .compose-widget {
        position: fixed !important;
        inset: 0 !important;
        width: auto !important;
        height: auto !important;
        max-height: none !important;
        border-radius: 0;
        z-index: 70;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Ayarlar → Güvenlik: password change */
.password-form { max-width: 420px; }
.password-field { position: relative; }
.password-field .settings-form-control { padding-right: 48px; }
.password-toggle {
    position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
    width: 40px; height: 40px; border: 0; background: transparent; border-radius: var(--radius-sm);
    color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.password-toggle:hover { color: var(--text-main); background: var(--bg-subtle); }
.password-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.password-rules { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.password-rules li { position: relative; padding-left: 24px; font-size: 13px; color: var(--text-muted); transition: color .2s; }
.password-rules li::before {
    content: ''; position: absolute; left: 4px; top: 50%; width: 10px; height: 10px; margin-top: -5px;
    border-radius: 50%; border: 2px solid var(--border-color); transition: background .2s, border-color .2s;
}
.password-rules li.ok { color: #15803d; }
.password-rules li.ok::before { background: #16a34a; border-color: #16a34a; }
html.dark .password-rules li.ok, [data-theme*="dark"] .password-rules li.ok { color: #4ade80; }
.password-error {
    margin: 4px 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px;
    background: rgba(220, 38, 38, .08); color: #b42318; border: 1px solid rgba(220, 38, 38, .25);
}
html.dark .password-error, [data-theme*="dark"] .password-error { color: #fca5a5; background: rgba(248, 113, 113, .1); }
