/* ============================================================
   OmniLetter → DocPigeon brand (landing-page "paper & ink")
   Overrides the Syncfusion Fluent2 CSS-variable theme.
   Loaded AFTER fluent2.css + app.css.
   ============================================================ */

:root {
    /* --- Primary / brand (landing --accent / --accent2 / --gold) --- */
    --color-sf-primary: #9a5a2f;
    --color-sf-primary-text-color: #fffdf7;
    --color-sf-primary-light: #e1cec1;
    --color-sf-primary-lighter: #f3ebdf;
    --color-sf-primary-dark: #7d4a26;
    --color-sf-primary-darker: #6c3f21;
    --color-sf-primary-label-color: #9a5a2f;
    --color-sf-primary-cell-selection: #f3ebdf;
    --color-sf-brand-primary: #9a5a2f;
    --color-sf-brand-primary-d10: #7d4a26;

    /* Pressed/selected/focus/hover derive from the Theme Studio brown scale */
    --color-sf-primary-bg-color: #9a5a2f;
    --color-sf-primary-border-color: #9a5a2f;
    --color-sf-primary-bg-color-hover: #8b512a;
    --color-sf-primary-border-color-hover: #8b512a;
    --color-sf-primary-bg-color-focus: #8b512a;
    --color-sf-primary-border-color-focus: #8b512a;
    --color-sf-primary-bg-color-pressed: #834d28;
    --color-sf-primary-border-color-pressed: #834d28;
    --color-sf-primary-bg-color-selected: #834d28;
    --color-sf-primary-border-color-selected: #834d28;
    --color-sf-primary-bg-color-disabled: #f0ebe0;
    --color-sf-primary-border-color-disabled: #f0ebe0;
    --color-sf-primary-text-disabled: #bdb29f;

    /* --- Surfaces (paper / card / paper2) --- */
    --color-sf-content-bg-color: #faf6ee;
    --color-sf-content-bg-color-alt1: #fffdf7;
    --color-sf-content-bg-color-alt2: #f4ecdd;
    --color-sf-content-bg-color-alt3: #efe6d5;
    --color-sf-content-bg-color-alt4: #f4ecdd;
    --color-sf-content-bg-color-alt5: #efe6d5;
    --color-sf-content-bg-color-alt6: #efe6d5;
    --color-sf-content-bg-color-hover: #f4ecdd;
    --color-sf-content-bg-color-focus: #f4ecdd;
    --color-sf-content-bg-color-pressed: #ded3be;
    --color-sf-content-bg-color-selected: #efe6d5;
    --color-sf-content-bg-color-dragged: #f4ecdd;
    --color-sf-content-bg-color-disabled: #f0ebe0;

    /* --- Text (ink / muted) --- */
    --color-sf-content-text-color: #2b2118;
    --color-sf-content-text-color-alt1: #3d352b;
    --color-sf-content-text-color-alt2: #5f5240;
    --color-sf-content-text-color-alt3: #7a6b58;
    --color-sf-content-text-color-hover: #2b2118;
    --color-sf-content-text-color-pressed: #2b2118;
    --color-sf-content-text-color-focus: #2b2118;
    --color-sf-content-text-color-selected: #2b2118;
    --color-sf-content-text-color-dragged: #2b2118;
    --color-sf-content-text-color-disabled: #bdb29f;
    --color-sf-placeholder-text-color: #a1937e;

    /* --- Borders (line) --- */
    --color-sf-border: #d8cfbb;
    --color-sf-border-light: #e8dfce;
    --color-sf-border-dark: #cfc4aa;
    --color-sf-border-hover: #7d4a26;
    --color-sf-border-pressed: #6c3f21;
    --color-sf-border-selected: #cfc4aa;
    --color-sf-border-dragged: #f4ecdd;
    --color-sf-border-focus: #9a5a2f;
    --color-sf-border-disabled: #e8dfce;
    --color-sf-flyout-border: #e8dfce;

    /* --- Semantic (warm-tuned info/warning; keep success/danger recognizable) --- */
    --color-sf-info: #7d4a26;
    --color-sf-info-bg-color: #7d4a26;
    --color-sf-info-bg-color-hover: #6c3f21;
    --color-sf-info-bg-color-pressed: #5a341c;
    --color-sf-warning: #9a6417;
    --color-sf-warning-bg-color: #b26a00;
    --color-sf-warning-bg-color-hover: #9a5a2f;
    --color-sf-warning-bg-color-pressed: #834d28;
}

body {
    background: #faf6ee;
    color: #2b2118;
    font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #2b2118;
}

/* Syncfusion controls inherit Inter */
.e-control, .e-input, .e-btn {
    font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
}

/* Cardinal components follow the palette via their own classes target the vars */
.e-card {
    border: 1px solid #e8dfce;
    border-radius: 10px;
    background: #fffdf7;
    color: #2b2118;
}
.e-card .e-card-header .e-card-header-caption .e-card-title {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 700;
    color: #2b2118;
}

/* Buttons: rounded, warm */
.e-btn.e-primary {
    background: #9a5a2f;
    border-color: #9a5a2f;
    color: #fffdf7;
    border-radius: 8px;
}
.e-btn.e-primary:hover { background: #8b512a; border-color: #8b512a; }
.e-btn.e-primary:active { background: #834d28; border-color: #834d28; }

/* Secondary "?" help buttons (no icon-font dependency: Fluent2 has no question glyph) */
.e-btn.help-question-btn {
    border-radius: 8px;
    font-weight: 600;
}
.e-btn.help-question-btn {
    min-width: 44px;
}

/* Page help dialog: pin the footer (Previous/Next/Done) to the bottom of the fixed-height dialog.
   In this Syncfusion version the <FooterTemplate> renders inside .e-dlg-content, so we make that
   a flex column, let the card expand, and push the footer (last child) to the bottom. */
.e-dialog.help-dialog {
    display: flex;
    flex-direction: column;
}
.e-dialog.help-dialog .e-dlg-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}
.e-dialog.help-dialog .e-dlg-content .e-card {
    flex: 1 1 auto;
}
.e-dialog.help-dialog .e-dlg-content > :last-child {
    margin-top: auto;
}

/* Page help dialog: template-language example blocks */
.help-example-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.help-example-code {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Grid: warm header + selection */
.e-grid .e-gridheader {
    background: #f4ecdd;
}
.e-grid .e-headercell {
    color: #5f5240;
    font-weight: 600;
}
.e-grid .e-rowcell.e-active,
.e-grid .e-rowcell.e-selectionbackground {
    background: #f3ebdf;
    color: #2b2118;
}

/* Inputs + floating labels (also covers Bootstrap form-floating on auth pages) */
.e-input, .e-textbox, .e-textarea,
.form-floating > .form-control {
    border: 1px solid #e8dfce;
    border-radius: 8px;
    background: #fffdf7;
}
.form-floating > label { color: #7a6b58; }

/* Calendar "today" + selection warm */
.e-calendar .e-today { color: #7d4a26; }

/* Focus ring warm */
.e-input:focus, .form-control:focus, .e-control:focus-visible {
    border-color: #9a5a2f;
    box-shadow: 0 0 0 1px rgba(154, 90, 47, 0.35);
}

/* Credit balance badge (used in the sidebar) */
.badge-brand { background: #9a5a2f; color: #fffdf7; }
.badge-brand-warn { background: #b26a00; color: #fffdf7; }
.badge-brand-danger { background: #b91c1c; color: #fffdf7; }

/* Auth pages use Bootstrap .btn-primary (not Syncfusion .e-btn) — warm it, scoped to the card */
.auth-card .btn-primary {
    background-color: #9a5a2f;
    border-color: #9a5a2f;
    color: #fffdf7;
    border-radius: 8px;
}
.auth-card .btn-primary:hover,
.auth-card .btn-primary:focus {
    background-color: #8b512a;
    border-color: #8b512a;
    color: #fffdf7;
}
.auth-card .btn-primary:active {
    background-color: #834d28;
    border-color: #834d28;
    color: #fffdf7;
}
.auth-card .btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(154, 90, 47, 0.25);
}
.auth-card .btn-danger {
    background-color: #b91c1c;
    border-color: #b91c1c;
    color: #fffdf7;
    border-radius: 8px;
}
.auth-card .btn-danger:hover,
.auth-card .btn-danger:focus {
    background-color: #a11717;
    border-color: #a11717;
}

/* Warm links + checkbox on auth card */
.auth-card a { color: #7d4a26; }
.auth-card .form-check-input:checked {
    background-color: #9a5a2f;
    border-color: #9a5a2f;
}
.auth-card .form-check-input:focus {
    border-color: #9a5a2f;
    box-shadow: 0 0 0 0.2rem rgba(154, 90, 47, 0.25);
}

/* ---------- Manage pages: warm notices, buttons, tables, link-buttons ---------- */
.notice {
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    margin: 0 0 1rem;
    border: 1px solid;
    background: #fffdf7;
}
.notice p { margin: 0; }
.notice strong { display: block; margin-bottom: 0.1rem; }
.notice a { color: inherit; text-decoration: underline; }
.notice-success {
    border-color: #cfe3cf;
    background: #f0f7ec;
    color: #2f5c2f;
}
.notice-danger {
    border-color: #ebc9c9;
    background: #fbf0ef;
    color: #8a2b23;
}
.notice-warning {
    border-color: #ecd9b8;
    background: #faf3e3;
    color: #7d4a26;
}
.notice-info {
    border-color: #d8cfbb;
    background: #f4ecdd;
    color: #5f5240;
}

/* Text color utility — .red is referenced across pages for error/required text, but
   basscss 8 does not ship color utilities, so define it here to actually render red. */
.red { color: #b91c1c; }

/* Manage card warm primary/danger buttons (in case a native button bypasses .e-btn) */
.manage-card .btn-primary { background:#9a5a2f; border-color:#9a5a2f; color:#fffdf7; border-radius:8px; }
.manage-card .btn-primary:hover { background:#8b512a; }
.manage-card .btn-danger { background:#b91c1c; border-color:#b91c1c; color:#fffdf7; border-radius:8px; }
.manage-card .btn-link { color:#7d4a26; }

/* Warm table used on ExternalLogins / Passkeys */
.manage-table { border-collapse: separate; border-spacing: 0; width: 100%; }
.manage-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid #e8dfce; }
.manage-table form { display: inline-flex; gap: 0.5rem; }

/* Correct .e-btn alignment so two stacked forms/links sit nicely */
.manage-card .e-btn { border-radius: 8px; }
.manage-card a.e-btn { text-decoration: none; }
