:root {
    --primary-color: #5b9279;
    --primary-dark: #48735f;
    --secondary-color: #f6f5f3;
    --text-color: #2c2c2c;
    --light-text: #555;
    --accent-color: #e8dcb9;
    --accent-dark: #e0cf9c;
    --danger-color: #c0392b;
    --danger-dark: #a93226;
    --success-color: #28a745;
    --radius: 12px;
    --shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

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

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--primary-dark);
}

/* --- Układ strony -------------------------------------------------------- */

.site-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    text-align: center;
    padding: 2.5rem 1rem;
}

.site-header h1 {
    font-size: 2.5rem;
    margin: 0 0 0.5rem;
}

.site-header h1 a {
    color: inherit;
    text-decoration: none;
}

.brand a {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: 0.02em;
}

.brand__logo {
    width: 3.5rem;
    height: 3.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.site-header p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    color: #f0f0f0;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    background-color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    padding: 0.8rem;
}

.site-nav__greeting {
    margin-right: 0.5rem;
}

.site-main {
    flex: 1;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.site-footer {
    background-color: var(--primary-dark);
    color: #eaeaea;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.95rem;
    margin-top: 3rem;
}

.site-footer__credits {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    opacity: 0.75;
}

.page-title {
    text-align: center;
    color: var(--primary-dark);
}

/* --- Przyciski ----------------------------------------------------------- */

.btn {
    display: inline-block;
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    font: inherit;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn--secondary {
    background-color: var(--light-text);
}

.btn--danger {
    background-color: var(--danger-color);
}

.btn--danger:hover {
    background-color: var(--danger-dark);
}

.btn--success {
    background-color: var(--success-color);
}

.btn--cta {
    background-color: var(--accent-color);
    color: #333;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: var(--radius);
}

.btn--cta:hover {
    background-color: var(--accent-dark);
    transform: scale(1.03);
}

.inline-form {
    display: inline;
    margin: 0;
}

/* --- Karty i sekcje ------------------------------------------------------ */

.card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.card h2,
.card h3 {
    color: var(--primary-dark);
    margin-top: 0;
}

.card--narrow {
    max-width: 480px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    padding: 1rem 0 2rem;
}

.hero h2 {
    font-size: 2rem;
    color: var(--primary-dark);
}

.hero p {
    font-size: 1.15rem;
    color: var(--light-text);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    text-align: center;
}

.info-grid p {
    color: var(--light-text);
}

.empty-state {
    text-align: center;
    margin-top: 3rem;
    font-size: 1.1rem;
}

/* --- Komunikaty ---------------------------------------------------------- */

.messages {
    list-style: none;
    padding: 0;
    margin: 0 auto 1.5rem;
    max-width: 700px;
}

.message {
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.message + .message {
    margin-top: 0.5rem;
}

.message--success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.message--error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.message--info,
.message--warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

/* --- Formularze ---------------------------------------------------------- */

.form-field {
    margin-bottom: 1rem;
}

.form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.form-field input:not([type="checkbox"]),
.form-field textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font: inherit;
}

.form-help {
    display: block;
    color: var(--light-text);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.form-errors {
    color: var(--danger-color);
    font-size: 0.9rem;
}

.form-errors ul {
    margin: 0.3rem 0;
    padding-left: 1.2rem;
}

/* --- Lista filmów -------------------------------------------------------- */

.video-card {
    max-width: 700px;
    margin: 2rem auto 0;
    padding: 1rem;
    text-align: center;
}

.video-status {
    margin: 0.5rem 0 1rem;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #ffeeba;
    background-color: #fff3cd;
    color: #856404;
}

.video-status--error {
    border-color: #f5c6cb;
    background-color: #f8d7da;
    color: #721c24;
}

.video-card video {
    width: 100%;
    border-radius: 8px;
    margin: 0.5rem 0 1rem;
    background: black;
}

/* --- Nagrywarka ---------------------------------------------------------- */

.recorder {
    text-align: center;
}

.recorder__notes {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.recorder__notes h3 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.recorder__notes textarea {
    width: 100%;
    height: 220px;
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid #ccc;
    resize: vertical;
    font: inherit;
}

.recorder__preview {
    width: 480px;
    max-width: 100%;
    border-radius: 10px;
    border: 3px solid var(--primary-color);
    background: black;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.recorder__timer {
    color: var(--danger-color);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.recorder__buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.recorder__status {
    min-height: 1.5em;
    color: var(--light-text);
}

.recorder__status--error {
    color: var(--danger-color);
}

@media (max-width: 700px) {
    .site-header h1 {
        font-size: 2rem;
    }

    .hero h2 {
        font-size: 1.6rem;
    }
}

/* --- Przekaz, adresaci, powiernicy -------------------------------------- */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.lead {
    max-width: 700px;
    margin: 0 auto 2rem;
    text-align: center;
    color: var(--light-text);
}

.status {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    background-color: var(--accent-color);
    color: #5c4a1a;
    font-size: 0.9rem;
    font-weight: 600;
}

.status--active {
    background-color: #d4edda;
    color: #155724;
}

.panel {
    max-width: 700px;
    margin: 0 auto 1.5rem;
}

.item-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e6e6e6;
}

.item:last-child {
    border-bottom: none;
}

.item__meta {
    display: block;
    color: var(--light-text);
    font-size: 0.9rem;
    font-weight: normal;
}

h3 .item__meta {
    display: inline;
}

.item__actions,
.video-card__actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.video-card__actions {
    justify-content: center;
}

.form-actions {
    gap: 1rem;
}

.btn--small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.checklist {
    padding-left: 1.2rem;
    color: var(--danger-color);
}

.form-field--checkbox {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}

.form-field--checkbox input {
    margin-top: 0.3rem;
}

.form-field--checkbox label {
    font-weight: normal;
    margin: 0;
}

/* --- Podgląd filmu ------------------------------------------------------- */

.video-tiles {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.video-tile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    height: 100%;
    padding: 0.75rem;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    background: var(--secondary-color);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.video-tile:hover {
    border-color: var(--primary-color);
    background: white;
}

.video-tile:hover .play-btn {
    background-color: var(--primary-dark);
}

.video-tile:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

.video-tile__text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.play-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0 0 0 2px;
    border: none;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.preview-dialog__close:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

.preview-dialog {
    width: min(720px, calc(100vw - 2rem));
    padding: 0;
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.preview-dialog::backdrop {
    background: rgba(20, 30, 25, 0.7);
}

.preview-dialog__body {
    padding: 1rem;
}

.preview-dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.preview-dialog__head h3 {
    margin: 0;
    color: var(--primary-dark);
}

.preview-dialog__close {
    flex-shrink: 0;
    width: 2.2rem;
    height: 2.2rem;
    border: none;
    border-radius: 50%;
    background: var(--secondary-color);
    color: var(--text-color);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.preview-dialog__close:hover {
    background: #e6e6e6;
}

.preview-dialog video {
    display: block;
    width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    background: black;
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .play-btn {
        transition: none;
    }
}

/* --- Instrukcja ---------------------------------------------------------- */

.help-toc ol {
    margin: 0;
    padding-left: 1.4rem;
    columns: 2 220px;
}

.help-toc li {
    margin-bottom: 0.3rem;
}

.help-step {
    scroll-margin-top: 1rem;
}

.help-step h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.help-step li {
    margin-bottom: 0.4rem;
}

.help-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
}

.help-tip {
    background-color: var(--secondary-color);
    border-left: 4px solid var(--accent-color);
    border-radius: 0 8px 8px 0;
    padding: 0.7rem 1rem;
    color: var(--light-text);
}

.faq dt {
    font-weight: 600;
    margin-top: 1rem;
}

.faq dd {
    margin: 0.3rem 0 0;
    color: var(--light-text);
}

/* --- Strona główna ------------------------------------------------------- */

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.btn--outline {
    background-color: transparent;
    color: var(--primary-dark);
    border: 2px solid var(--primary-color);
    padding: calc(1rem - 2px) 2rem;
    font-size: 1.2rem;
    border-radius: var(--radius);
}

.btn--outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.home-section {
    margin-top: 3.5rem;
}

.home-photo {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero--with-photo {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 2.5rem;
    align-items: center;
    text-align: left;
}

.hero--with-photo p {
    margin-left: 0;
}

.hero--with-photo .hero__actions {
    justify-content: flex-start;
}

.home-photo--wide {
    aspect-ratio: 21 / 8;
    object-fit: cover;
    margin: 1.5rem 0 0;
}

.closing__photo {
    max-width: 640px;
    margin: 0 auto 1.5rem;
}

@media (max-width: 800px) {
    .hero--with-photo {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .hero--with-photo p {
        margin-left: auto;
    }

    .hero--with-photo .hero__actions {
        justify-content: center;
    }

    .home-photo--wide {
        aspect-ratio: 16 / 9;
    }
}

.section-title {
    text-align: center;
    color: var(--primary-dark);
    font-size: 1.7rem;
    margin: 0 0 0.75rem;
}

.ideas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.idea {
    padding: 1.5rem;
}

.idea__icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.idea h3 {
    margin-bottom: 0.5rem;
}

.idea p,
.how-steps p {
    margin: 0;
    color: var(--light-text);
}

.how-steps {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.how-steps li {
    padding: 1.5rem;
    text-align: center;
}

.how-steps h3 {
    margin: 0.75rem 0 0.5rem;
}

.how-steps__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: var(--primary-dark);
    font-size: 1.4rem;
    font-weight: 700;
}

.trust {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    background: linear-gradient(135deg, #ffffff, #eef4f0);
}

.trust p {
    margin: 0 auto;
    max-width: 640px;
    color: var(--light-text);
}

.closing {
    text-align: center;
}

.closing__quote {
    max-width: 640px;
    margin: 0 auto 1.5rem;
    font-size: 1.25rem;
    font-style: italic;
    color: var(--primary-dark);
}
