:root {
    --ifaistos-primary: #0b3155;
    --ifaistos-primary-2: #164f81;
    --ifaistos-accent: #ee6328;
    --ifaistos-accent-soft: #fff0e9;
    --ifaistos-bg: #f4f7fa;
    --ifaistos-text: #14263a;
    --ifaistos-muted: #68788b;
    --ifaistos-border: #dfe7ef;
    --ifaistos-card: #ffffff;
    --ifaistos-success: #1d7652;
    --shadow-card: 0 22px 56px rgba(11, 31, 52, .10);
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--ifaistos-text);
    background: var(--ifaistos-bg);
}
a { color: inherit; text-decoration: none; }

/* SERVER ADMIN SHELL */
.server-shell { min-height: 100vh; display: flex; }
.sidebar {
    width: 278px;
    background: linear-gradient(180deg, #092945 0%, #0b3155 52%, #08243e 100%);
    color: #d7e4ef;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
}
.brand {
    padding: 23px 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    gap: 13px;
}
.brand-symbol { display: block; width: 48px; height: 48px; flex: 0 0 48px; }
.brand h1 { font-size: 18px; margin: 0; color: #fff; font-weight: 700; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 4px; color: #9eb8cd; font-size: 12px; }
.nav { padding: 21px 12px; flex: 1; }
.nav-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #7796ae; padding: 0 12px; margin: 8px 0 11px; font-weight: 700; }
.nav-label-spaced { margin-top: 29px; }
.nav a { display: block; padding: 12px 13px; border-radius: 11px; margin-bottom: 5px; font-size: 14px; transition: background .18s ease, color .18s ease; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.11); color: #fff; }
.nav a.active { box-shadow: inset 3px 0 0 var(--ifaistos-accent); }
.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,.1); }

.content-shell {
    margin-left: 270px;
    min-height: 100vh;
    width: calc(100% - 270px);
}

.topbar {
    height: 68px;
    background: white;
    border-bottom: 1px solid var(--ifaistos-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.page {
    padding: 28px;
    width: 100%;
    max-width: none;
}
.topbar h2 { font-size: 20px; margin: 0; letter-spacing: -.02em; }
.admin-chip { font-size: 13px; color: var(--ifaistos-muted); border: 1px solid var(--ifaistos-border); border-radius: 30px; padding: 9px 13px; }

.card { background: #fff; border: 1px solid var(--ifaistos-border); border-radius: 18px; padding: 23px; box-shadow: 0 4px 14px rgba(15, 23, 42, .035); }
.grid { display:grid; gap:18px; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 22px 0; }
.stat-value { font-size: 30px; font-weight: 700; color: var(--ifaistos-primary); }
.stat-label { color: var(--ifaistos-muted); font-size: 14px; margin-top: 5px; }
.heading-row { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:20px; }
.heading-row h3 { margin:0 0 6px; }
.muted { color: var(--ifaistos-muted); }

/* COMMON FORMS */
.form-grid { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:16px; }
.form-group label { display:block; font-size:13.5px; font-weight:650; margin-bottom:8px; color: #22394e; }
.form-group label em { color: var(--ifaistos-accent); font-style: normal; }
.form-group input {
    width:100%;
    border:1px solid #d3dde7;
    border-radius:11px;
    height:49px;
    padding:0 14px;
    font-size:14.5px;
    color: var(--ifaistos-text);
    background: #fff;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.form-group input::placeholder { color: #9aa8b5; }
.form-group input:focus { outline:none; border-color:#3278ad; box-shadow:0 0 0 4px rgba(36,105,158,.13); }
.full { grid-column: 1 / -1; }
.field-hint { display: block; margin-top: 7px; color: #7d8b98; font-size: 12px; }
.btn { border:0; border-radius:11px; padding:13px 19px; font-weight:650; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:9px; font-size:14px; transition: transform .14s ease, box-shadow .14s ease, background .14s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ifaistos-accent); color:#fff; box-shadow:0 10px 23px rgba(238,99,40,.22); }
.btn-primary:hover { background:#df5820; box-shadow:0 13px 25px rgba(238,99,40,.29); }
.btn-outline { background:transparent; border:1px solid rgba(255,255,255,.2); color:#e8f1f7; }
.btn-block { width:100%; }
.alert { padding:12px 15px; border-radius:11px; margin-bottom:17px; font-size:14px; line-height: 1.45; }
.alert-success { color:#11603c; background:#e8f7ee; }
.alert-danger { color:#8d2333; background:#fcecef; border: 1px solid #f4d1d7; }
.alert-warning { color:#805b08; background:#fff4d9; }
.table { width:100%; border-collapse:collapse; }
.table th, .table td { padding:13px 12px; border-bottom:1px solid var(--ifaistos-border); text-align:left; font-size:14px; }
.table th { color:var(--ifaistos-muted); font-weight:600; }
.badge { padding:5px 9px; border-radius:999px; font-size:12px; font-weight:600; }
.badge-success { background:#e7f7ef; color:#12643d; }
.badge-muted { background:#eef1f4; color:#596273; }
.toggle-form { display:flex; align-items:center; gap:10px; }

/* INSTALLATION / LOGIN EXPERIENCE */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(400px, 44%) 1fr;
    background: #fff;
}
.auth-brand-panel {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 17%, rgba(242,103,40,.22), transparent 31%),
        linear-gradient(145deg, #08243e 0%, #0c365b 55%, #0d426e 100%);
    color: #fff;
    min-height: 100vh;
}
.auth-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .16;
    background-image:
        linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
    background-size: 62px 62px;
    mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 72%);
}
.auth-brand-panel::after {
    content: "";
    position: absolute;
    right: -160px;
    bottom: -190px;
    width: 560px;
    height: 560px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.02);
}
.auth-brand-inner {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: clamp(34px, 6vw, 66px) clamp(32px, 6vw, 70px);
    display: flex;
    flex-direction: column;
}
.auth-brand-head { display:flex; align-items:center; gap:16px; }
.ifaistos-symbol { display:block; width:70px; height:70px; flex: 0 0 70px; }
.auth-product-name { font-size:26px; font-weight:720; letter-spacing:-.045em; }
.auth-product-name span { color: #f47a3c; font-weight: 650; }
.auth-product-subtitle { font-size:12px; color:#a9c6dd; letter-spacing:.04em; margin-top:5px; }
.auth-brand-copy { margin: auto 0 66px; max-width: 495px; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.05);
    color: #afcce2;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .15em;
    text-transform: uppercase;
    border-radius: 100px;
    padding: 9px 13px;
    margin-bottom: 24px;
}
.auth-brand-copy h2 { font-size: clamp(37px, 3.3vw, 49px); line-height:1.08; letter-spacing:-.06em; margin:0 0 19px; max-width: 470px; }
.auth-brand-copy p { color:#b9cedf; font-size:15.5px; line-height:1.72; margin:0; max-width:455px; }
.brand-features { display:grid; grid-template-columns:repeat(3,1fr); gap:0; max-width: 505px; border-top:1px solid rgba(255,255,255,.13); padding-top:24px; }
.brand-features div { display:flex; align-items:flex-start; gap:11px; }
.brand-features strong { color: #ef6a2d; font-size:12px; letter-spacing:.06em; padding-top:2px; }
.brand-features span { color:#bdcfdd; font-size:12px; line-height:1.55; text-transform:uppercase; letter-spacing:.08em; }
.auth-form-panel {
    min-height: 100vh;
    background: #f8fafc;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    position: relative;
    padding: 36px clamp(25px, 5vw, 74px) 52px;
}
.auth-card {
    width: min(665px, 100%);
    background: var(--ifaistos-card);
    border: 1px solid #e4eaf0;
    padding: clamp(29px, 4vw, 43px);
    border-radius: 23px;
    box-shadow: var(--shadow-card);
}
.setup-head { margin-bottom: 30px; }
.setup-badge { display:inline-flex; align-items:center; gap:8px; color:#68788b; letter-spacing:.16em; font-size:10.5px; font-weight:750; margin-bottom:15px; }
.setup-badge span { width:8px; height:8px; border-radius:50%; background:var(--ifaistos-accent); box-shadow:0 0 0 5px rgba(238,99,40,.12); }
.setup-head h1 { margin:0 0 10px; font-size:31px; line-height:1.17; letter-spacing:-.045em; color:#12263a; }
.setup-head p { margin:0; color:var(--ifaistos-muted); line-height:1.65; font-size:14.5px; max-width:560px; }
.setup-head strong { color:var(--ifaistos-primary); }
.form-section { padding: 0 0 25px; margin-bottom:25px; border-bottom:1px solid #edf1f5; }
.form-section-admin { margin-bottom: 24px; }
.section-title { display:flex; gap:13px; align-items:flex-start; margin-bottom:19px; }
.section-number { width:34px; height:34px; display:inline-flex; justify-content:center; align-items:center; flex:0 0 34px; border-radius:10px; background:var(--ifaistos-accent-soft); color:var(--ifaistos-accent); font-size:12px; font-weight:750; letter-spacing:.06em; }
.section-title h2 { margin:1px 0 3px; font-size:16px; letter-spacing:-.025em; }
.section-title p { color:var(--ifaistos-muted); margin:0; font-size:12.5px; }
.setup-actions { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:19px; }
.security-note { display:flex; align-items:flex-start; gap:9px; flex:1 1 265px; color:#6f8090; font-size:12px; line-height:1.55; }
.security-dot { display:block; width:18px; height:18px; flex:0 0 18px; border-radius:50%; position:relative; background:#eef5f9; margin-top:1px; }
.security-dot::before { content:""; width:7px; height:7px; position:absolute; left:6px; top:6px; border-radius:50%; background:#2472a8; }
.btn-install { min-width:208px; height:51px; }
.btn-install span { font-size:18px; line-height:1; }
.auth-footer { position:absolute; bottom:22px; left:0; right:0; text-align:center; font-size:11px; text-transform:uppercase; letter-spacing:.14em; color:#93a0ad; }
.login-form .btn-install { width:100%; margin-top:4px; }
.login-head { margin-bottom:28px; }

/* PUBLIC PLACEHOLDER */
.welcome { min-height:100vh; display:grid; place-items:center; padding:24px; background:linear-gradient(145deg,#08243e,#174b75); color:white; text-align:center; }
.welcome-card { max-width:720px; }
.welcome h1 { font-size:42px; margin: 10px 0 14px; }
.welcome p { font-size:18px; color:#c5d9e9; line-height:1.6; }

@media (max-width: 1120px) {
    .auth-page { grid-template-columns: 38% 1fr; }
    .auth-brand-copy h2 { font-size: 36px; }
    .brand-features { grid-template-columns:1fr; gap:14px; }
}
@media (max-width: 900px) {
    .auth-page { grid-template-columns:1fr; }
    .auth-brand-panel { min-height:auto; }
    .auth-brand-inner { min-height:auto; padding:27px 24px 30px; }
    .auth-brand-copy, .brand-features { display:none; }
    .ifaistos-symbol { width:58px; height:58px; flex-basis:58px; }
    .auth-product-name { font-size:22px; }
    .auth-form-panel { min-height:calc(100vh - 112px); justify-content:flex-start; padding:25px 16px 52px; }
    .auth-card { padding:26px 20px; border-radius:18px; }
    .setup-head h1 { font-size:27px; }
    .form-grid { grid-template-columns:1fr; }
    .setup-actions { flex-direction:column; align-items:stretch; }
    .btn-install { width:100%; }
    .sidebar { display:none; }
    .content-shell { margin-left:0; width:100%; }
    .stats { grid-template-columns:1fr; }
    .page { padding:18px; }
}
