/* =============================================================
 * LWS Szkolenia - custom.css
 * Mobile-first. Jeden breakpoint: 992px (desktop).
 * ============================================================= */

:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --accent: #1a73e8;
    --accent-dark: #155bb5;
    --success: #2f9e44;
    --warning: #e8a13a;
    --danger: #dc2626;
    --green: #79a53c;

    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-lg: 0 6px 20px rgba(0,0,0,.08);
    --transition: .2s ease;
    --container: 1180px;
}

/* ===== LAYOUT ===== */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 800px; }
.site-main { min-height: 60vh; padding: 24px 0 64px; }

.mt { margin-top: 48px; }
.mb { margin-bottom: 48px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: .5em; padding: 10px 20px; border-radius: var(--radius);
    font-weight: 600; font-size: 15px; line-height: 1.2;
    border: 1px solid transparent; cursor: pointer;
    text-decoration: none; transition: var(--transition);
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary { background: #4b5563; color: #fff; }
.btn-secondary:hover { background: #374151; color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #f3f4f6; color: var(--text); }
.btn-disabled { background: #f3f4f6; color: #9ca3af; border-color: var(--border); cursor: not-allowed; }

/* ===== ALERTS ===== */
.alert { padding: 12px 16px; border-radius: var(--radius); background: #f3f4f6; margin: 0 0 16px; }
.alert-success { background: #ecfdf5; color: #065f46; border-left: 3px solid var(--success); }
.alert-warning { background: #fffbeb; color: #78350f; border-left: 3px solid var(--warning); }

/* ===== BADGES ===== */
.badge { display: inline-block; padding: 2px 10px; font-size: 12px; font-weight: 600; border-radius: 999px; background: #e5e7eb; color: #374151; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #78350f; }
.badge-muted { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }

/* ===== HEADER ===== */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border);padding: 20px 0; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; flex-wrap: wrap; }
.site-header__logo img { max-height: 40px; width: auto; }
.site-header__nav { display: flex; align-items: center; }
.site-header__toggle {
    display: inline-flex; flex-direction: column; gap: 4px; width: 36px; height: 36px;
    align-items: center; justify-content: center; background: transparent; border: 1px solid var(--border); border-radius: var(--radius);
}
.site-header__toggle span { display: block; width: 18px; height: 2px; background: var(--text); }
#primary-menu { display: none; list-style: none; margin: 0; padding: 0; }
.site-header__nav.is-open #primary-menu {
    display: flex; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0;
    background: var(--surface); border-top: 1px solid var(--border); padding: 8px 16px; gap: 0;
    z-index: 50;
}
#primary-menu li { padding: 0; }
#primary-menu a { display: block; padding: 10px 0; color: var(--text); }
.site-header__account { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ===== FOOTER ===== */
.site-footer { background: #111827; color: #d1d5db; margin-top: 64px; }
.site-footer a { color: #d1d5db; }
.site-footer a:hover { color: #fff; }
.site-footer__grid { display: grid; gap: 32px; padding: 48px 16px; }
.site-footer__col h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 12px; }
.site-footer__logo { max-width: 180px; margin-bottom: 12px; filter: brightness(0) invert(1); }
.site-footer__contact { list-style: none; padding: 0; margin: 0 0 16px; }
.site-footer__contact li { padding: 4px 0; }
.site-footer__gazele { display: block; max-width: 140px; }
.footer-menu { list-style: none; padding: 0; margin: 0; }
.footer-menu li { padding: 4px 0; }
.site-footer__bottom { padding: 16px!important; border-top: 1px solid rgba(255,255,255,.1); color: #9ca3af; font-size: 13px; }

/* ===== HERO / FRONT PAGE ===== */
.hero-front { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%); color: #fff; padding: 64px 0; text-align: center; }
.hero-front h1 { color: #fff; font-size: 32px; margin-bottom: 16px; }
.hero-front p { font-size: 17px; max-width: 720px; margin: 0 auto 24px; opacity: .95; }
.hero-front .btn-primary { background: #fff; color: var(--accent); }
.hero-front .btn-primary:hover { background: #f3f4f6; color: var(--accent-dark); }

/* ===== SZKOLENIE PROMO ===== */
.szkolenie-promo { padding: 48px 0; }
.szkolenie-promo__inner { display: grid; gap: 24px; }
.szkolenie-promo__media img { width: 100%; height: auto; border-radius: var(--radius-lg); aspect-ratio: 16/10; object-fit: cover; }
.szkolenie-promo__body .eyebrow { display: inline-block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.szkolenie-promo__body h2 { font-size: 26px; margin-bottom: 12px; }

/* ===== SZKOLENIA GRID ===== */
.szkolenia-grid { padding: 48px 0; }
.szkolenia-grid h2 { font-size: 24px; margin-bottom: 24px; }
.szkolenia-grid__list { display: grid; gap: 16px; }
.szkolenie-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition); }
.szkolenie-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.szkolenie-card__link { color: var(--text); text-decoration: none; display: block; }
.szkolenie-card__link:hover { text-decoration: none; }
.szkolenie-card__media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.szkolenie-card__body { padding: 16px 20px 20px; }
.szkolenie-card__body h3 { font-size: 18px; margin-bottom: 8px; }
.szkolenie-card__body p { color: var(--text-muted); font-size: 14px; margin-bottom: 12px; }

/* ===== SINGLE SZKOLENIE ===== */
.szkolenie-hero { position: relative; padding: 64px 0; color: #fff; background: var(--accent-dark); overflow: hidden; }
.szkolenie-hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .35; }
.szkolenie-hero__inner { position: relative; }
.szkolenie-hero h1 { color: #fff; font-size: 32px; margin-bottom: 12px; }
.szkolenie-hero .lead { font-size: 17px; max-width: 700px; opacity: .95; }
.szkolenie-desc { padding: 32px 0; }
.szkolenie-done, .szkolenie-expired { padding: 24px 0; }

.lekcje-grid { padding: 32px 0 64px; }
.lekcje-grid h2 { font-size: 22px; margin-bottom: 20px; }
.lekcje-grid__list { display: grid; gap: 16px; }
.lekcja-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.lekcja-card.is-done { border-color: var(--success); }
.lekcja-card__media { position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg, #4b5563 0%, #1f2937 100%); }
.lekcja-card__media img { width: 100%; height: 100%; object-fit: cover; }
.lekcja-card__num { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.95); color: var(--text); font-weight: 800; font-size: 18px; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.lekcja-card__body { padding: 16px 20px 20px; }
.lekcja-card__body h3 { font-size: 17px; margin-bottom: 12px; }
.lekcja-card__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lekcja-card__score { font-size: 13px; color: var(--text-muted); width: 100%; }

/* ===== LEKCJA VIEW ===== */
.lekcja-view { padding: 32px 0 64px; }
.lekcja-view__crumbs { margin-bottom: 16px; font-size: 14px; }
.lekcja-view h1 { font-size: 28px; margin-bottom: 24px; }
.lekcja-progress { margin-bottom: 24px; }
.lekcja-progress__bar { background: var(--border); border-radius: 4px; height: 6px; overflow: hidden; margin-bottom: 8px; }
.lekcja-progress__bar span { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.lekcja-progress__text { font-size: 13px; color: var(--text-muted); }

.lekcja-slides { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; min-height: 320px; margin-bottom: 24px; }
.lekcja-slide { display: none; }
.lekcja-slide.is-active { display: block; }
.lekcja-slide img { border-radius: var(--radius); }
.lekcja-slide figure { margin: 0 0 16px; }
.lekcja-slide figcaption { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 8px; }
.lekcja-gallery { aspect-ratio: 16/9; background: #f3f4f6; border-radius: var(--radius); }
.lekcja-gallery img { width: 100%; height: 100%; object-fit: contain; }

.lekcja-nav { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 24px; }

.icon-cols { display: grid; gap: 16px; }
.icon-cols__item { padding: 16px; background: #f9fafb; border-radius: var(--radius); text-align: center; }
.icon-cols__item img { margin: 0 auto 8px; width: 64px; height: 64px; object-fit: contain; }

/* ===== TEST ===== */
.lekcja-test { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.lekcja-test h2 { font-size: 22px; margin-bottom: 16px; }
.test-q { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; background: #f9fafb; }
.test-q legend { font-weight: 600; padding: 0 6px; }
.test-q.is-correct { border-color: var(--success); background: #ecfdf5; }
.test-q.is-wrong { border-color: var(--danger); background: #fef2f2; }
.test-q__opt { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; cursor: pointer; }
.test-q__opt input { margin-top: 4px; }
.test-actions { margin-top: 16px; }
.lws-test-result { padding: 16px; margin-top: 16px; border-radius: var(--radius); }
.lws-test-result.is-pass { background: #ecfdf5; border-left: 3px solid var(--success); }
.lws-test-result.is-fail { background: #fef2f2; border-left: 3px solid var(--danger); }

/* ===== AUTH PAGES ===== */
.auth-page { padding: 48px 0; }
.auth-page h1 { font-size: 26px; margin-bottom: 24px; text-align: center; }
.auth-page .narrow { max-width: 420px; }
#loginform p, .lws-form p { margin: 0 0 14px; }
#loginform label, .lws-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
#loginform input[type=text], #loginform input[type=password], .lws-form input[type=text], .lws-form input[type=password], .lws-form input[type=email] {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 15px; background: #fff;
}
#loginform input:focus, .lws-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,115,232,.15); }
#loginform .submit { margin-top: 16px; }
#loginform input[type=submit] {
    width: 100%; padding: 11px 20px; background: var(--accent); color: #fff; border: 0; border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer;
}
#loginform input[type=submit]:hover { background: var(--accent-dark); }
.login-remember { font-weight: 400 !important; display: flex; align-items: center; gap: 6px; }
.auth-page__links { text-align: center; margin-top: 16px; font-size: 14px; }

/* ===== USER PANEL / MODERATOR PANEL ===== */
.user-panel, .moderator-panel { padding: 32px 0 64px; }
.user-panel__header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.user-panel__header h1 { font-size: 26px; margin: 0; }
.account-info, .account-pw { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 16px; }
.account-info ul { list-style: none; padding: 0; margin: 0; }
.account-info li { padding: 4px 0; }

/* Tabela "Moje szkolenia" - mobile karty */
.szkolenia-table { display: grid; gap: 12px; }
.szkolenia-table__head { display: none; }
.szkolenia-table__row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: grid; gap: 12px; }
.szkolenia-table__name a { font-weight: 700; font-size: 17px; color: var(--text); }
.szkolenia-table__name a:hover { color: var(--accent); }
.szkolenia-table__score { color: var(--text-muted); font-size: 14px; }
.szkolenia-table__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Moderator table */
.moderator-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: auto; }
.moderator-table__head, .moderator-table__row { display: grid; gap: 0; padding: 12px 16px; border-bottom: 1px solid var(--border); align-items: center; min-width: 600px; }
.moderator-table__head { background: #f3f4f6; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.moderator-table__row:last-child { border-bottom: 0; }
.cell-status .badge { display: inline-block; }
.cell-status small { display: block; color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.firma-name { color: var(--text-muted); font-size: 14px; }

/* 404 */
.page-404 { padding: 96px 0; text-align: center; }
.page-404 h1 { font-size: 96px; line-height: 1; color: var(--accent); margin-bottom: 8px; }
.page-404 p { color: var(--text-muted); margin-bottom: 24px; }

/* page-title block */
.page-title { padding: 48px 0; background: var(--accent-dark); color: #fff; }
.page-title.has-bg { background-size: cover; background-position: center; }
.page-title h1 { color: #fff; }
.page-title .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .85; margin-bottom: 8px; }
.breadcrumbs { font-size: 13px; opacity: .85; }
.breadcrumbs a { color: inherit; }

/* gallery */
.gallery .swiper { width: 100%; aspect-ratio: 16/9; }
.gallery .swiper-slide img { width: 100%; height: 100%; object-fit: cover; }

/* icon-text-columns */
.icon-text-columns__list { display: grid; gap: 24px; }
.icon-text-columns__item { text-align: center; padding: 16px; }
.icon-text-columns__icon { margin-bottom: 12px; }
.icon-text-columns__icon img { margin: 0 auto; width: 80px; height: 80px; object-fit: contain; }

/* image block */
.image-block figure { margin: 0; }
.image-block img { width: 100%; height: auto; border-radius: var(--radius-lg); }
.image-block figcaption { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 8px; }

/* ===== DESKTOP 992px+ ===== */
@media (min-width: 992px) {
    .site-header__inner { padding: 16px 24px; }
    .site-header__toggle { display: none; }
    #primary-menu { display: flex !important; position: static; flex-direction: row; gap: 24px; padding: 0; border: 0; background: transparent; }
    #primary-menu a { padding: 0; }

    .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; padding: 64px 24px !important; }
    .container { padding: 0 24px; }

    .hero-front { padding: 96px 0; }
    .hero-front h1 { font-size: 48px; }
    .hero-front p { font-size: 19px; }

    .szkolenie-promo__inner { grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; }
    .szkolenie-promo__body h2 { font-size: 32px; }

    .szkolenia-grid__list { grid-template-columns: repeat(3, 1fr); gap: 24px; }

    .szkolenie-hero { padding: 96px 0; }
    .szkolenie-hero h1 { font-size: 42px; }

    .lekcje-grid__list { grid-template-columns: repeat(3, 1fr); gap: 24px; }

    .lekcja-view h1 { font-size: 36px; }
    .lekcja-slides { padding: 40px; min-height: 400px; }
    .icon-cols { grid-template-columns: repeat(3, 1fr); gap: 24px; }

    .icon-text-columns__list { grid-template-columns: repeat(2, 1fr); }
    .icon-text-columns.cols-3 .icon-text-columns__list { grid-template-columns: repeat(3, 1fr); }
    .icon-text-columns.cols-4 .icon-text-columns__list { grid-template-columns: repeat(4, 1fr); }

    /* Tabela "Moje szkolenia" - na desktop prawdziwa tabela */
    .szkolenia-table__head, .szkolenia-table__row { grid-template-columns: 2fr 1fr 1.2fr; align-items: center; }
    .szkolenia-table__head { display: grid; padding: 14px 20px; background: #1f2937; color: #fff; border-radius: var(--radius-lg); font-weight: 700; }
    .szkolenia-table__row { padding: 18px 20px; }

    /* Moderator table - dynamiczna liczba kolumn (4 + N szkoleń) */
    .moderator-table__head, .moderator-table__row {
        grid-template-columns: 1.5fr 1fr repeat(auto-fit, minmax(140px, 1fr));
    }

    .mt { margin-top: 80px; }
    .mb { margin-bottom: 80px; }
}
