/* ══════════════════════════════════════════════════════════════
   TEPLOMATIK — Klientska zona
   Customer portal stylesheet
   ══════════════════════════════════════════════════════════════ */

/* ══════ LOCAL FONTS ══════ */

/* Playfair Display — latin-ext (Czech diacritics) */
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('https://teplomatik.cz/assets/fonts/playfair-display-latin-ext.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;
}

/* Playfair Display — latin */
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('https://teplomatik.cz/assets/fonts/playfair-display-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans — latin-ext */
@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url('https://teplomatik.cz/assets/fonts/ibm-plex-sans-latin-ext.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;
}

/* IBM Plex Sans — latin */
@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url('https://teplomatik.cz/assets/fonts/ibm-plex-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono — latin-ext (light) */
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('https://teplomatik.cz/assets/fonts/ibm-plex-mono-light-latin-ext.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;
}

/* IBM Plex Mono — latin (light) */
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('https://teplomatik.cz/assets/fonts/ibm-plex-mono-light-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ══════ DESIGN TOKENS ══════ */

:root {
    color-scheme: dark;
    --coal: #0a0a0e;
    --surface: #111115;
    --surface-raised: #16161c;
    --ember: #c96a3f;
    --ember-bright: #d9845a;
    --ember-deep: #a85530;
    --ember-text: #1c0a02;
    --text: #a0a0b0;
    --text-bright: #e8e8f0;
    --text-sub: #686878;
    --text-mute: #3e3e4c;
    --border: #1e1e28;
    --radius: 8px;
    --sidebar-width: 200px;
    --header-height: 56px;
    --transition: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ══════ RESET ══════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100%;
    background: var(--coal);
    color: var(--text);
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.6;
}

a { color: var(--ember-bright); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--ember); }

img { max-width: 100%; display: block; }

/* ══════ LOGIN PAGE ══════ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 45% at 50% 100%, rgba(160, 85, 40, 0.04), transparent 70%),
        radial-gradient(ellipse 60% 50% at 50% 55%, rgba(180, 100, 50, 0.015), transparent);
}

.login-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 512px;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 420px;
    max-width: 100%;
    background: rgba(17, 17, 21, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 50px 120px rgba(0, 0, 0, 0.7),
        0 16px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    animation: loginCardIn 0.8s var(--transition) forwards;
    opacity: 0;
    transform: translateY(12px) scale(0.99);
}

@keyframes loginCardIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-accent {
    height: 2px;
    background: linear-gradient(90deg,
        transparent 8%,
        var(--ember-deep) 25%,
        var(--ember-bright) 50%,
        var(--ember-deep) 75%,
        transparent 92%);
    box-shadow: 0 0 14px rgba(201, 106, 63, 0.12);
}

.login-card::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 15%;
    right: 15%;
    height: 80px;
    background: radial-gradient(ellipse at 50% 0%, rgba(201, 106, 63, 0.025), transparent 70%);
    pointer-events: none;
}

.login-header {
    padding: 2.4rem 2.2rem 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

.login-logo {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.login-logo span {
    color: var(--ember);
}

.login-subtitle {
    font-size: 0.58rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-sub);
    margin-bottom: 0.5rem;
}

.login-divider {
    width: 60px;
    height: 1px;
    margin: 1.2rem auto 0;
    background: linear-gradient(90deg, transparent, var(--ember-deep), var(--ember), var(--ember-deep), transparent);
    box-shadow: 0 0 10px rgba(201, 106, 63, 0.08);
}

.login-error {
    background: rgba(220, 60, 60, 0.12);
    border: 1px solid rgba(220, 60, 60, 0.25);
    color: #e05555;
    font-size: 0.82rem;
    padding: 0.7rem 1rem;
    border-radius: 6px;
    margin: 1.4rem 2.2rem 0;
}

.login-form {
    padding: 1.8rem 2.2rem 1.2rem;
    position: relative;
    z-index: 1;
}

.login-form .form-group {
    margin-bottom: 1.2rem;
}

.login-form .form-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.56rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-sub);
    margin-bottom: 0.5rem;
}

.login-form .form-label svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    opacity: 0.5;
}

.login-form .input-wrap {
    position: relative;
}

.login-form .input-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 50%;
    height: 2px;
    background: linear-gradient(90deg, var(--ember-deep), var(--ember-bright), var(--ember-deep));
    box-shadow: 0 0 8px rgba(201, 106, 63, 0.2);
    transition: left 0.5s var(--transition), right 0.5s var(--transition);
    border-radius: 0 0 6px 6px;
    z-index: 2;
}

.login-form .input-wrap:focus-within::after {
    left: 0;
    right: 0;
}

.login-form .form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 0.82rem 1rem;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 400;
    color: var(--text-bright);
    outline: none;
    transition: border-color 0.35s, box-shadow 0.35s, background 0.35s;
}

.login-form .form-input:hover {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

.login-form .form-input:focus {
    border-color: rgba(201, 106, 63, 0.25);
    box-shadow: 0 0 0 3px rgba(201, 106, 63, 0.04);
    background: rgba(255, 255, 255, 0.03);
}

.login-form .form-input::placeholder {
    color: var(--text-mute);
    font-weight: 300;
}

.login-submit {
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.85rem;
    background: linear-gradient(180deg,
        #da8a58 0%,
        var(--ember-bright) 20%,
        var(--ember) 55%,
        var(--ember-deep) 100%);
    border: none;
    border-radius: var(--radius);
    color: var(--ember-text);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.4s, transform 0.4s;
    box-shadow:
        0 4px 16px rgba(201, 106, 63, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.login-submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: left 0.8s var(--transition);
    pointer-events: none;
}

.login-submit:hover {
    box-shadow:
        0 8px 32px rgba(201, 106, 63, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.login-submit:hover::after { left: 120%; }

.login-submit:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(201, 106, 63, 0.12),
        inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

.login-footer {
    padding: 1rem 2.2rem 1.8rem;
    text-align: center;
}

.login-footer a {
    font-size: 0.76rem;
    color: var(--text-sub);
    transition: color 0.3s;
}

.login-footer a:hover {
    color: var(--ember-bright);
}

.login-secure {
    padding: 0.8rem 2.2rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-secure svg {
    width: 11px;
    height: 11px;
    stroke: var(--text-mute);
    fill: none;
    stroke-width: 1.5;
    opacity: 0.45;
}

.login-secure span {
    font-size: 0.54rem;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    color: var(--text-mute);
    letter-spacing: 0.05em;
}

.login-secure .dot {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--text-mute);
}

/* ══════ APP LAYOUT ══════ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */

.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transition: transform 0.35s var(--transition);
}

.sidebar-header {
    padding: 1.4rem 1.2rem 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.sidebar-logo span {
    color: var(--ember);
}

.sidebar-zone {
    font-size: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-sub);
}

.sidebar-nav {
    flex: 1;
    padding: 0.8rem 0;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-sub);
    text-decoration: none;
    transition: color 0.3s, background 0.3s;
    border-left: 2px solid transparent;
}

.sidebar-nav a:hover {
    color: var(--text-bright);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-nav a.active {
    color: var(--ember-bright);
    background: rgba(201, 106, 63, 0.06);
    border-left-color: var(--ember);
}

.sidebar-nav a svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem 1.2rem;
    border-top: 1px solid var(--border);
    font-size: 0.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    color: var(--text-mute);
    letter-spacing: 0.06em;
}

/* ── Header ── */

.app-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 40;
}

.app-header-title {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-bright);
}

.app-header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-header-name {
    font-size: 0.78rem;
    color: var(--text-sub);
}

.app-header-logout {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-sub);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 400;
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.3s, border-color 0.3s, background 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.app-header-logout:hover {
    color: var(--text-bright);
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.app-header-logout svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Mobile toggle ── */

.mobile-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text);
    padding: 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.3s, border-color 0.3s;
}

.mobile-toggle:hover {
    color: var(--text-bright);
    border-color: rgba(255, 255, 255, 0.1);
}

.mobile-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 8, 0.7);
    z-index: 45;
}

/* ── Main content ── */

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2rem 2rem 3rem;
    min-height: calc(100vh - var(--header-height));
}

/* ══════ CONTENT COMPONENTS ══════ */

.page-welcome {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.3rem;
}

.page-desc {
    font-size: 0.82rem;
    color: var(--text-sub);
    margin-bottom: 2rem;
}

.content-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.content-card-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-mute);
    font-size: 0.86rem;
}

.content-card-empty svg {
    width: 40px;
    height: 40px;
    stroke: var(--text-mute);
    fill: none;
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin: 0 auto 1rem;
    opacity: 0.4;
}

/* ══════ GENERAL FORM STYLES ══════ */

.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--text-sub);
    margin-bottom: 0.4rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 0.7rem 0.9rem;
    font-family: inherit;
    font-size: 0.84rem;
    color: var(--text-bright);
    outline: none;
    transition: border-color 0.35s, box-shadow 0.35s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: rgba(201, 106, 63, 0.25);
    box-shadow: 0 0 0 3px rgba(201, 106, 63, 0.04);
}

/* ══════ BUTTON STYLES ══════ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: box-shadow 0.35s, transform 0.35s, background 0.35s;
}

.btn-primary {
    background: linear-gradient(180deg,
        #da8a58 0%,
        var(--ember-bright) 20%,
        var(--ember) 55%,
        var(--ember-deep) 100%);
    color: var(--ember-text);
    box-shadow:
        0 4px 16px rgba(201, 106, 63, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.btn-primary:hover {
    box-shadow:
        0 8px 32px rgba(201, 106, 63, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-sub);
}

.btn-ghost:hover {
    color: var(--text-bright);
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

/* ══════ RESPONSIVE ══════ */

@media (max-width: 768px) {
    :root {
        --sidebar-width: 240px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .app-header {
        left: 0;
    }

    .app-main {
        margin-left: 0;
        padding: 1.5rem 1rem 2rem;
    }

    .mobile-toggle {
        display: flex;
    }

    .login-card {
        border-radius: 12px;
    }

    .login-header {
        padding: 2rem 1.5rem 0;
    }

    .login-form {
        padding: 1.5rem 1.5rem 1rem;
    }

    .login-footer {
        padding: 0.8rem 1.5rem 1.5rem;
    }

    .login-secure {
        padding: 0.8rem 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .login-logo {
        font-size: 1.6rem;
    }

    .page-welcome {
        font-size: 1.15rem;
    }
}
