/* ============================================================
   base.css — Global styles for Customer Portal
   ============================================================
   Structure:
   1. Font
   2. CSS variables (colors) — update these to change the theme
   3. Reset
   4. Body
   5. Header (shared across all pages)
   6. Footer (shared across all pages)
   7. Shared components (buttons, form controls, error messages)
   ============================================================ */


/* 1. Font
──────────────────────────────────────────────────────────── */
@font-face {
    font-family: 'Sohne Buch';
    src: url('/fonts/Sohne-Buch.woff2') format('woff2'),
         url('/fonts/Sohne-Buch.woff')  format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


/* 2. CSS variables — change colors here
──────────────────────────────────────────────────────────── */
:root {
    --font:              'Sohne Buch', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --color-primary:     #ff5722;
    --color-primary-hover: #e64a19;

    --color-bg:          #f5f5f5;
    --color-card:        #ffffff;
    --color-text:        #1a1a1a;
    --color-muted:       #6b7280;
    --color-border:      #cacbcd;

    --color-error:       #dc2626;
    --color-error-bg:    #fef2f2;
}

.bg-grey {
    background-color: #e8e9ed;
}


/* 3. Reset
──────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* 4. Body
──────────────────────────────────────────────────────────── */
body {
    font-family: var(--font);
    /* background: var(--color-bg);
    color: var(--color-text); */
}


/* 5. Header (shared)
──────────────────────────────────────────────────────────── */
.site-header {
    min-height: 70px;
    border-bottom: 1px solid var(--color-border);
    display: block;
    position: relative;
    z-index: 100;
    transition: box-shadow 0.2s;
}

.site-header--sticky {
    position: sticky;
    top: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.site-header--sticky .site-header-nav {
    display: flex;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}

.brand-logo { height: 28px; }

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    /* font-size: 14px;
    color: var(--color-muted); */
}

.btn-logout {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    color: var(--color-text);
    font-family: var(--font);
}

.btn-logout:hover { background: var(--color-bg); }

/* ── Sticky header nav (desktop) ──────────────────────────────── */
.site-header-nav {
    display: none;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex: 1;
    padding: 0 32px;
}

.site-header-nav-link {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.site-header-nav-link:hover {
    background: rgba(0,0,0,0.05);
    color: var(--color-primary);
}

/* ── Hamburger button (mobile only) ───────────────────────────── */
.site-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    width: 36px;
    height: 36px;
}

.site-hamburger span {
    display: block;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.site-header--menu-open .site-hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.site-header--menu-open .site-hamburger span:nth-child(2) {
    opacity: 0;
}
.site-header--menu-open .site-hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile nav drawer ────────────────────────────────────────── */
.site-mobile-nav {
    display: none;
    flex-direction: column;
    border-top: 1px solid var(--color-border);
    padding: 12px 0 16px;
}

.site-header--menu-open .site-mobile-nav {
    display: flex;
}

.site-mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
}

.site-mobile-nav-link:last-child { border-bottom: none; }

.site-mobile-nav-link:hover { color: var(--color-primary); }

.site-mobile-nav-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.site-mobile-nav-icon svg {
    width: 24px;
    height: 24px;
}

/* ── Responsive header ────────────────────────────────────────── */
@media (max-width: 1023.98px) {
    .site-hamburger { display: flex; }
    .site-header--sticky .site-header-nav { display: none; }
    #user-name { display: none !important; }
}

.header-academy-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 6px 14px;
}
.header-academy-link:hover { background: var(--color-bg); }


/* 6. Footer (shared)
──────────────────────────────────────────────────────────── */
.site-footer {
    height: 80px;
    background: #fff;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    /* padding: 0 32px; */
}

.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-links a,
.footer-social a {
    color: var(--color-muted);
    text-decoration: none;
    margin-right: 14px;
    font-size: 14px;
}

.footer-links a:hover,
.footer-social a:hover { color: var(--color-text); }

.footer-social a { margin-right: 0; margin-left: 14px; }

.footer-copy { font-size: 14px; color: #aaa; }


/* 7. Shared components
──────────────────────────────────────────────────────────── */

/* Primary button */
.btn-primary {
    background: var(--color-primary);
    border: none;
    border-radius: 6px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    color: #fff;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--color-primary-hover);
    color: #fff;
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Link-style button */
.btn-link-custom {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.btn-link-custom:hover { color: var(--color-primary-hover); }

/* Form controls */
.form-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.form-control {
    border: 1.5px solid #ddd;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--color-text);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.12);
    outline: none;
}

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Error message */
.error-msg {
    font-size: 13px;
    color: var(--color-error);
    background: var(--color-error-bg);
    border-radius: 5px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.2s;
}

.error-msg.visible {
    padding: 5px;
    max-height: 80px;
}


/* ── Bootstrap container width override (≥ 1400px → 1540px) ── */
@media (min-width: 1400px) {
    .container,
    .container-xxl,
    .container-xl,
    .container-lg,
    .container-md,
    .container-sm {
        max-width: 1540px;
    }
}
