/* FireTranslate – UI on top of Bootstrap 5 */

:root {
    --ft-brand: #ea580c;
    --ft-brand-dark: #c2410c;
    --ft-brand-soft: #fff1e7;
    --ft-grad: linear-gradient(135deg, #f97316 0%, #e11d48 100%);
    --ft-bg: #f5f6fa;
    --ft-surface: #ffffff;
    --ft-border: #e7e9f0;
    --ft-text: #1f2433;
    --ft-muted: #6b7280;
    --ft-radius: 14px;
    --ft-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --ft-shadow-lg: 0 10px 30px -12px rgba(16, 24, 40, .18);
    --bs-body-bg: var(--ft-bg);
    --bs-body-color: var(--ft-text);
    --bs-border-color: var(--ft-border);
    --bs-link-color: var(--ft-brand-dark);
    --bs-link-hover-color: #9a3412;
    --bs-link-color-rgb: 194, 65, 12;
    --bs-primary: var(--ft-brand);
    --bs-primary-rgb: 234, 88, 12;
    --bs-focus-ring-color: rgba(234, 88, 12, .25);
}

body {
    background: var(--ft-bg);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn:hover, .nav-link:hover, .list-group-item:hover, .dropdown-item:hover, .ft-card-link:hover { text-decoration: none; }

h1, .h1, h2, .h2, h3, .h3, h4, .h4 { letter-spacing: -.015em; font-weight: 650; }
.text-secondary { color: var(--ft-muted) !important; }

/* ---------------------------------------------------------------- buttons */
.btn { border-radius: 10px; font-weight: 500; }
.btn-sm { border-radius: 8px; }
.btn-ft { background: var(--ft-grad); color: #fff; border: 0; box-shadow: 0 6px 14px -6px rgba(234, 88, 12, .6); }
.btn-ft:hover, .btn-ft:focus { color: #fff; filter: brightness(1.05); box-shadow: 0 8px 18px -6px rgba(234, 88, 12, .7); }
.btn-ft:active { filter: brightness(.95); }
.btn-outline-primary { --bs-btn-color: var(--ft-brand-dark); --bs-btn-border-color: #fdba74; --bs-btn-hover-bg: var(--ft-brand); --bs-btn-hover-border-color: var(--ft-brand); --bs-btn-active-bg: var(--ft-brand-dark); }
.btn-outline-secondary { --bs-btn-color: #374151; --bs-btn-border-color: var(--ft-border); --bs-btn-bg: #fff; --bs-btn-hover-bg: #f3f4f6; --bs-btn-hover-color: #111827; --bs-btn-hover-border-color: #d1d5db; }
.form-control, .form-select { border-radius: 10px; border-color: #dfe2ea; }
.form-control:focus, .form-select:focus { border-color: #fdba74; box-shadow: 0 0 0 .2rem rgba(234, 88, 12, .15); }
.form-check-input:checked { background-color: var(--ft-brand); border-color: var(--ft-brand); }
.form-label { font-weight: 500; }

/* ---------------------------------------------------------------- top bar */
.ft-topbar {
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--ft-border);
    position: sticky; top: 0; z-index: 1020;
}
.ft-topbar .navbar-brand { font-weight: 700; letter-spacing: -.02em; color: var(--ft-text); display: flex; align-items: center; gap: .55rem; }
.ft-logo {
    width: 32px; height: 32px; border-radius: 10px; background: var(--ft-grad);
    display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.05rem;
    box-shadow: 0 6px 14px -6px rgba(225, 29, 72, .55);
}
.ft-topbar .nav-link { color: #4b5563; font-weight: 500; border-radius: 8px; padding: .4rem .75rem !important; }
.ft-topbar .nav-link:hover, .ft-topbar .nav-link.show { color: var(--ft-text); background: #f3f4f6; }
.ft-avatar {
    width: 30px; height: 30px; border-radius: 50%; background: #fde7d6; color: var(--ft-brand-dark);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 650; font-size: .85rem;
}
.dropdown-menu { border-radius: 12px; border-color: var(--ft-border); box-shadow: var(--ft-shadow-lg); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .7rem; }
.dropdown-item:active { background: var(--ft-brand); }

.ft-main { max-width: 1320px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }

/* ---------------------------------------------------------------- cards & surfaces */
.card, .ft-card {
    background: var(--ft-surface); border: 1px solid var(--ft-border); border-radius: var(--ft-radius);
    box-shadow: var(--ft-shadow);
}
.card-body { padding: 1.25rem 1.35rem; }
.card h2.h6, .card .h6 { font-weight: 650; }
.ft-card-link { display: block; color: inherit; transition: transform .12s ease, box-shadow .12s ease, border-color .12s; }
.ft-card-link:hover { transform: translateY(-2px); box-shadow: var(--ft-shadow-lg); border-color: #fed7aa; color: inherit; }
.list-group { border-radius: var(--ft-radius); box-shadow: var(--ft-shadow); }
.list-group-item { border-color: var(--ft-border); }
.table { --bs-table-bg: transparent; }
.ft-table { background: #fff; border: 1px solid var(--ft-border); border-radius: var(--ft-radius); box-shadow: var(--ft-shadow); overflow: hidden; }
.ft-table .table { margin: 0; }
.ft-table thead th { background: #fafbfc; color: var(--ft-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-bottom-width: 1px; padding-top: .7rem; padding-bottom: .7rem; }
.ft-table td, .ft-table th { padding-left: 1rem; padding-right: 1rem; }
.table > :not(caption) > * > * { border-bottom-color: var(--ft-border); }
.alert { border-radius: 12px; border: 0; box-shadow: var(--ft-shadow); }
.alert-success { background: #ecfdf3; color: #05603a; }
.alert-danger { background: #fef3f2; color: #b42318; }
.alert-warning { background: #fffaeb; color: #93370d; }
.alert-info, .alert-secondary { background: #f2f4f7; color: #344054; }
.badge { font-weight: 600; }
.badge-tag { background: #f2f4f7; color: #344054; font-weight: 500; border-radius: 6px; }
.text-bg-info { background: #e0f2fe !important; color: #075985 !important; }

/* ---------------------------------------------------------------- page headers */
.ft-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.ft-page-head h1 { margin: 0; font-size: 1.6rem; }
.ft-page-head .ft-sub { color: var(--ft-muted); margin-top: .2rem; }
.ft-breadcrumb { font-size: .85rem; color: var(--ft-muted); margin-bottom: .35rem; }
.ft-breadcrumb a { color: var(--ft-muted); }
.ft-breadcrumb a:hover { color: var(--ft-brand-dark); }

.ft-project-avatar {
    width: 48px; height: 48px; border-radius: 14px; background: var(--ft-grad); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.25rem;
    flex-shrink: 0; box-shadow: 0 8px 18px -8px rgba(225, 29, 72, .5);
}
.ft-project-avatar.sm { width: 38px; height: 38px; border-radius: 11px; font-size: 1rem; }
.ft-stat-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.ft-stat-chip { background: #fff; border: 1px solid var(--ft-border); border-radius: 999px; padding: .25rem .75rem; font-size: .85rem; color: #344054; }
.ft-stat-chip strong { color: var(--ft-text); }

.project-tabs { gap: .25rem; border-bottom: 1px solid var(--ft-border) !important; margin-bottom: 1.5rem; flex-wrap: nowrap; overflow-x: auto; }
.project-tabs .nav-link { color: var(--ft-muted); font-weight: 500; border-bottom: 2px solid transparent; border-radius: 0; padding: .6rem .9rem; white-space: nowrap; }
.project-tabs .nav-link:hover { color: var(--ft-text); }
.project-tabs .nav-link.active { color: var(--ft-brand-dark); border-bottom-color: var(--ft-brand); }
.project-tabs .nav-link i { margin-right: .3rem; }

/* ---------------------------------------------------------------- progress */
.progress { background: #eef0f4; border-radius: 999px; }
.progress-thin { height: .45rem; }
.progress-bar { background: linear-gradient(90deg, #22c55e, #16a34a); border-radius: 999px; }
.progress-bar.bg-success { background: linear-gradient(90deg, #22c55e, #16a34a) !important; }
.ft-percent { font-weight: 700; font-size: 1.5rem; letter-spacing: -.02em; }
.ft-percent small { font-size: .9rem; color: var(--ft-muted); font-weight: 600; }

/* ---------------------------------------------------------------- flags */
.lang-flag-wrap { display: inline-flex; align-items: center; }
.lang-flag { width: 20px; height: 15px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(16, 24, 40, .12); flex-shrink: 0; }
.lang-flag-none { display: inline-flex; align-items: center; justify-content: center; box-shadow: none; color: var(--ft-muted); font-size: .9rem; }
.lang-chip { display: inline-flex; align-items: center; gap: .35rem; background: #f2f4f7; border-radius: 6px; padding: .1rem .45rem; font-family: var(--bs-font-monospace); font-size: .8rem; color: #344054; }
.ft-flags { display: inline-flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.ft-flags .more { font-size: .75rem; color: var(--ft-muted); }
.lang-flag-lg .lang-flag { width: 32px; height: 24px; border-radius: 4px; }

/* ---------------------------------------------------------------- dashboard / project cards */
.ft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.ft-project-card { padding: 1.15rem 1.2rem; height: 100%; display: flex; flex-direction: column; gap: .8rem; }
.ft-project-card .name { font-weight: 650; font-size: 1.05rem; color: var(--ft-text); }
.ft-project-card .meta { font-size: .82rem; color: var(--ft-muted); }
.ft-empty { text-align: center; padding: 3rem 1rem; color: var(--ft-muted); background: #fff; border: 1px dashed #d0d5dd; border-radius: var(--ft-radius); }
.ft-empty i { font-size: 2rem; color: #d0d5dd; display: block; margin-bottom: .5rem; }

/* language cards on the project overview */
.ft-lang-card { padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .7rem; height: 100%; }
.ft-lang-card .lang-name { font-weight: 650; }
.ft-lang-card .actions { margin-top: auto; display: flex; gap: .5rem; }
.ft-lang-card.is-reference { border-color: #bae6fd; }

/* ---------------------------------------------------------------- editor */
.ft-toolbar { background: #fff; border: 1px solid var(--ft-border); border-radius: var(--ft-radius); box-shadow: var(--ft-shadow); padding: .75rem; margin-bottom: 1rem; position: sticky; top: 64px; z-index: 10; }
.editor-row { background: #fff; border: 1px solid var(--ft-border); border-radius: 12px; padding: 1rem 1.1rem !important; margin: 0 0 .75rem 0 !important; box-shadow: var(--ft-shadow); transition: border-color .2s, box-shadow .2s; }
.editor-row:hover { border-color: #d0d5dd; }
.editor-row.is-saved { border-color: #86efac; box-shadow: 0 0 0 3px rgba(34, 197, 94, .12); }
.editor-row textarea { font-size: .95rem; min-height: 2.6rem; border-radius: 10px; }
.editor-row .source { background: #f8f9fb; border: 1px solid #eef0f4; border-radius: 10px; padding: .45rem .75rem; min-height: 2.6rem; }
.editor-row.htmx-request { opacity: .6; }
.term-key { font-family: var(--bs-font-monospace); font-size: .82rem; word-break: break-all; color: #475467; }
.text-pre { white-space: pre-wrap; }
.editor-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ft-muted); font-weight: 600; padding: 0 1.1rem .4rem; }

/* ---------------------------------------------------------------- auth */
.ft-auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.ft-auth-hero {
    background: radial-gradient(1200px 600px at -10% -10%, #fb923c 0%, transparent 55%),
                radial-gradient(900px 600px at 110% 110%, #e11d48 0%, transparent 55%),
                linear-gradient(135deg, #7c2d12 0%, #9f1239 100%);
    color: #fff; padding: 3.5rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.ft-auth-hero h1 { font-size: 2.4rem; font-weight: 750; line-height: 1.15; max-width: 28rem; }
.ft-auth-hero p.lead { opacity: .85; max-width: 30rem; }
.ft-auth-hero .feature { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: 1rem; opacity: .95; }
.ft-auth-hero .feature i { background: rgba(255, 255, 255, .16); border-radius: 10px; padding: .4rem .5rem; }
.ft-auth-hero .brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; }
.ft-auth-hero .brand .ft-logo { background: rgba(255, 255, 255, .18); box-shadow: none; }
.ft-auth-hero .flags-deco { display: flex; flex-wrap: wrap; gap: .45rem; opacity: .9; }
.ft-auth-hero .flags-deco img { width: 28px; height: 21px; border-radius: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.ft-auth-form { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; }
.ft-auth-form .inner { width: 100%; max-width: 400px; }
.ft-auth-form h2 { font-size: 1.6rem; }
@media (max-width: 900px) {
    .ft-auth { grid-template-columns: 1fr; }
    .ft-auth-hero { padding: 2rem; }
    .ft-auth-hero .hide-sm { display: none; }
}
.auth-card { max-width: 440px; margin: 8vh auto; }

/* ---------------------------------------------------------------- misc */
.toast { border-radius: 12px; }
code { color: #b42318; }
.lang-chip code, .ft-stat-chip code { color: inherit; }
.btn-link { text-decoration: none; }
.btn-link:hover { text-decoration: underline; }
.editor-head .lang-flag-wrap { margin-right: .35rem; vertical-align: -2px; }
