:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --text: #1d2733;
    --muted: #667085;
    --border: #dfe4ea;
    --primary: #1769aa;
    --primary-hover: #12568c;
    --danger: #c62828;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --max-width: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--text);
    background: var(--bg);
}

body {
    margin: 0;
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
}

header > a {
    display: inline-block;
    margin-right: 28px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}

header nav {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

header nav form {
    margin: 0;
}

main {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 32px auto;
    min-height: 65vh;
}

footer {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 30px auto;
    padding: 20px 0;
    color: var(--muted);
    text-align: center;
}

body > hr {
    display: none;
}

h1 {
    margin-top: 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

h2 {
    margin-top: 28px;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    padding: 9px 16px;
    border: 0;
    border-radius: 7px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
}

button:hover {
    background: var(--primary-hover);
}

input,
select,
textarea {
    max-width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
}

textarea {
    width: 100%;
}

form p {
    margin: 12px 0;
}

article {
    padding: 20px;
    margin: 18px 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

article h2,
article h3 {
    margin-top: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

th,
td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

th {
    background: #eef2f6;
}

img {
    max-width: 100%;
}

@media (max-width: 700px) {
    header {
        padding: 14px 16px;
    }

    header > a {
        display: block;
        margin: 0 0 14px;
    }

    header nav {
        display: flex;
        gap: 10px 14px;
    }

    main {
        width: min(100% - 20px, var(--max-width));
        margin-top: 20px;
    }

    table {
        font-size: 0.9rem;
    }
}

/* ============================================================
   STRONA GŁÓWNA
   ============================================================ */

.hero {
    padding: 64px 48px;
    margin-bottom: 42px;
    border-radius: 18px;
    background:
        linear-gradient(
            135deg,
            #163d63 0%,
            #1769aa 60%,
            #2584c7 100%
        );
    color: #fff;
    box-shadow: var(--shadow);
}

.hero-content {
    max-width: 760px;
}

.hero-kicker,
.section-kicker {
    margin: 0 0 6px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-kicker {
    color: #d6ebff;
}

.hero h1 {
    margin-bottom: 16px;
    font-size: clamp(2.2rem, 6vw, 4rem);
    line-height: 1.05;
}

.hero-text {
    max-width: 650px;
    margin: 0 0 28px;
    font-size: 1.15rem;
    color: #eaf4ff;
}

.hero-free-listing {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    max-width: 650px;
    margin: 0 0 36px;
    padding: 13px 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.10);
}

.hero-free-listing strong {
    flex-basis: 100%;
    font-size: 1.05rem;
    color: #ffffff;
}

.hero-free-listing span {
    position: relative;
    padding-left: 18px;
    color: #eaf4ff;
    font-size: 0.94rem;
}

.hero-free-listing span::before {
    content: "✓";
    position: absolute;
    left: 0;
    font-weight: 700;
    color: #ffffff;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.button {
    display: inline-block;
    padding: 11px 20px;
    border-radius: 8px;
    font-weight: 650;
    text-decoration: none;
}

.button:hover {
    text-decoration: none;
}

.button-primary {
    background: #fff;
    color: #174f7d;
}

.button-primary:hover {
    background: #eef6fc;
}

.button-secondary {
    border: 1px solid rgba(255, 255, 255, 0.65);
    color: #fff;
}

.button-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.home-section {
    margin: 42px 0;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
}

.section-kicker {
    color: var(--primary);
}

.ad-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.ad-card {
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.ad-card-promoted {
    border-color: #f0b429;
}

.ad-card-image {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e9eef3;
}

.ad-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.ad-card:hover .ad-card-image img {
    transform: scale(1.025);
}

.ad-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--muted);
    font-weight: 600;
}

.ad-card-body {
    padding: 18px;
}

.ad-card-body h3 {
    margin: 8px 0 6px;
    font-size: 1.2rem;
}

.ad-card-body h3 a {
    color: var(--text);
}

.ad-price {
    margin: 8px 0 12px;
    font-size: 1.35rem;
    font-weight: 750;
}

.ad-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--muted);
    font-size: 0.92rem;
}

.ad-badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    background: #fff2cc;
    color: #7a5600;
    font-size: 0.78rem;
    font-weight: 700;
}

.empty-state {
    padding: 50px 24px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}

@media (max-width: 900px) {
    .ad-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero {
        padding: 48px 30px;
    }
}

@media (max-width: 600px) {
    .ad-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 38px 22px;
        border-radius: 12px;
    }

    .hero-free-listing {
        gap: 7px;
        padding: 12px 14px;
    }

    .hero-free-listing span {
        flex-basis: 100%;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ============================================================
   LISTA OGŁOSZEŃ
   ============================================================ */

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.page-heading h1 {
    margin-bottom: 6px;
}

.page-description {
    margin: 0;
    color: var(--muted);
}

.button-solid {
    background: var(--primary);
    color: #fff;
}

.button-solid:hover {
    background: var(--primary-hover);
    color: #fff;
}

.button-light {
    background: #eef2f6;
    color: var(--text);
}

.button-light:hover {
    background: #e2e8ee;
    color: var(--text);
}

.button-danger {
    border: 0;
    background: #b42318;
    color: #fff;
    cursor: pointer;
}

.button-danger:hover {
    background: #912018;
    color: #fff;
}

.search-panel {
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.search-panel h2 {
    margin: 0 0 18px;
    font-size: 1.25rem;
}

.search-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.search-fields p {
    margin: 0;
}

.search-fields label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 650;
}

.search-fields input,
.search-fields select {
    width: 100%;
}

.search-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.list-section {
    margin-top: 10px;
}

.ad-card-topline {
    min-height: 24px;
}

.status-badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-reserved {
    background: #fff0d6;
    color: #8a5a00;
}

@media (max-width: 900px) {
    .search-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-fields {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   SZCZEGÓŁY OGŁOSZENIA
   ============================================================ */

.ad-detail-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 28px;
}

.ad-detail-header h1 {
    margin-bottom: 8px;
}

.ad-detail-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: var(--muted);
}

.ad-detail-price {
    flex-shrink: 0;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    white-space: nowrap;
}

.ad-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    align-items: start;
}

.ad-detail-main {
    min-width: 0;
}

.ad-gallery {
    margin-bottom: 28px;
}

.ad-main-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #e9eef3;
}

.ad-main-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ad-status-photo img {
    object-fit: contain;
}

.ad-no-photo {
    color: var(--muted);
    font-size: 1.1rem;
    font-weight: 600;
}

.ad-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.ad-thumbnail {
    padding: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #e9eef3;
}

.ad-thumbnail:hover {
    background: #e9eef3;
    border-color: #a8c9e5;
}

.ad-thumbnail.active {
    border-color: var(--primary);
}

.ad-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-section {
    padding: 26px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.ad-section h2 {
    margin: 0 0 22px;
    font-size: 1.35rem;
}

.ad-spec-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.ad-spec {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.ad-spec span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.85rem;
}

.ad-spec strong {
    font-size: 1rem;
}

.ad-description {
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.ad-detail-sidebar {
    position: sticky;
    top: 20px;
}

.seller-card,
.owner-card {
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.seller-card hr {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.seller-card-label {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.seller-card-price {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
}

.seller-name {
    margin: 4px 0 18px;
    font-size: 1.15rem;
    font-weight: 700;
}

.seller-action {
    display: block;
    width: 100%;
    margin-top: 10px;
}

.contact-button {
    display: block;
    width: 100%;
    text-align: center;
}

.revealed-contact {
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
}

.owner-card h2 {
    margin: 0 0 16px;
    font-size: 1.15rem;
}

.owner-action {
    display: block;
    width: 100%;
    margin-top: 9px;
    text-align: center;
}

.button-muted {
    background: #eef2f6;
    color: var(--text);
}

.button-muted:hover {
    background: #dfe6ed;
    color: var(--text);
}

.ad-secondary-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 6px;
    font-size: 0.92rem;
}

.reservation-list {
    display: grid;
    gap: 14px;
}

.reservation-box {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.reservation-box h3 {
    margin-top: 0;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-actions form {
    margin: 0;
}

.muted {
    color: var(--muted);
}

@media (max-width: 950px) {
    .ad-detail-layout {
        grid-template-columns: 1fr;
    }

    .ad-detail-sidebar {
        position: static;
    }

    .ad-spec-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .ad-detail-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .ad-detail-price {
        font-size: 2rem;
    }

    .ad-main-photo {
        aspect-ratio: 4 / 3;
        border-radius: 10px;
    }

    .ad-thumbnails {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    .ad-section {
        padding: 20px;
    }

    .ad-spec-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================================
   NAGŁÓWEK, NAWIGACJA, KOMUNIKATY, STOPKA
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.site-header-inner {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-logo {
    flex-shrink: 0;
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}

.site-logo:hover {
    color: var(--primary);
    text-decoration: none;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.site-nav > a,
.nav-logout {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 11px;
    border-radius: 7px;
    color: var(--text);
    font-size: 0.93rem;
    font-weight: 600;
}

.site-nav > a:hover,
.nav-logout:hover {
    background: #eef3f7;
    color: var(--primary);
    text-decoration: none;
}

.site-nav .nav-add-ad {
    background: var(--primary);
    color: #fff;
}

.site-nav .nav-add-ad:hover {
    background: var(--primary-hover);
    color: #fff;
}

.site-nav .nav-login {
    border: 1px solid var(--primary);
    color: var(--primary);
}

.site-nav .nav-login:hover {
    background: var(--primary);
    color: #fff;
}

.nav-logout-form {
    margin: 0;
}

.nav-logout {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.messages-container {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 18px auto 0;
}

.site-message {
    padding: 13px 16px;
    border: 1px solid #b7d7f0;
    border-radius: 8px;
    background: #eef7ff;
    color: #174f7d;
}

.site-message-success {
    border-color: #b8dfc3;
    background: #edf8f0;
    color: #246b38;
}

.site-message-warning {
    border-color: #ead49b;
    background: #fff8e6;
    color: #765500;
}

.site-message-error {
    border-color: #edb4b4;
    background: #fff0f0;
    color: #9b2828;
}

.site-main {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 32px auto;
    min-height: 65vh;
}

.site-footer {
    margin-top: 60px;
    padding: 34px 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
}

.site-footer-inner {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 28px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.footer-brand strong {
    color: var(--text);
    font-size: 1.05rem;
}

.footer-brand span {
    font-size: 0.9rem;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copy {
    margin: 0;
    white-space: nowrap;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .site-header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 0;
        gap: 10px;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .site-footer-inner {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

@media (max-width: 600px) {
    .site-header {
        position: static;
    }

    .site-header-inner {
        width: min(100% - 20px, var(--max-width));
    }

    .site-nav {
        width: 100%;
        gap: 4px;
    }

    .site-nav > a,
    .nav-logout {
        padding: 7px 9px;
        font-size: 0.88rem;
    }

    .messages-container,
    .site-main,
    .site-footer-inner {
        width: min(100% - 20px, var(--max-width));
    }
}

/* ============================================================
   FORMULARZ OGŁOSZENIA
   ============================================================ */

.form-section {
    padding: 26px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.form-section-heading {
    margin-bottom: 22px;
}

.form-section-heading h2 {
    margin: 0 0 6px;
    font-size: 1.35rem;
}

.form-section-heading p {
    margin: 0;
    color: var(--muted);
}

.main-form-fields p,
.photo-upload-fields p {
    margin: 0 0 18px;
}

.main-form-fields label,
.photo-upload-fields label {
    display: block;
    margin-bottom: 6px;
    font-weight: 650;
}

.main-form-fields input,
.main-form-fields select,
.main-form-fields textarea,
.photo-upload-fields input {
    width: 100%;
}

.main-form-fields textarea {
    min-height: 180px;
    resize: vertical;
}

.helptext {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.85rem;
}

.errorlist {
    margin: 6px 0;
    padding-left: 20px;
    color: var(--danger);
    font-weight: 600;
}

.photo-manager {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.photo-manager-item {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}

.photo-manager-label {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    font-size: 0.88rem;
    font-weight: 650;
}

.photo-main-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #dceeff;
    color: #16598d;
    font-size: 0.78rem;
}

.photo-manager-image {
    aspect-ratio: 4 / 3;
    background: #e9eef3;
}

.photo-manager-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.photo-manager-actions {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
}

.photo-manager-actions form {
    margin: 0;
}

.photo-manager-actions button {
    padding: 7px 9px;
    font-size: 0.82rem;
}

.purchase-consents {
    display: grid;
    gap: 12px;
    margin: 22px 0;
}

.purchase-consent {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.purchase-consent label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-weight: 500;
    line-height: 1.5;
}

.purchase-consent input[type="checkbox"] {
    width: auto;
    flex: 0 0 auto;
    margin-top: 4px;
}

.purchase-legal-note {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.purchase-legal-note a {
    font-weight: 650;
}

.form-submit-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.form-submit-button {
    min-width: 180px;
    font-weight: 700;
}

@media (max-width: 900px) {
    .photo-manager {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .form-section {
        padding: 20px;
    }

    .photo-manager {
        grid-template-columns: 1fr;
    }

    .form-submit-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .form-submit-bar button,
    .form-submit-bar .button {
        width: 100%;
        text-align: center;
    }
}

/* ============================================================
   MOJE OGŁOSZENIA
   ============================================================ */

.my-ads-list {
    display: grid;
    gap: 18px;
}

.my-ad-card {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.my-ad-image {
    display: block;
    min-height: 210px;
    background: #e9eef3;
}

.my-ad-image img {
    width: 100%;
    height: 100%;
    min-height: 210px;
    display: block;
    object-fit: cover;
}

.my-ad-content {
    padding: 22px;
}

.my-ad-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.my-ad-heading h2 {
    margin: 0 0 6px;
    font-size: 1.35rem;
}

.my-ad-heading h2 a {
    color: var(--text);
}

.my-ad-price {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 750;
}

.my-ad-status {
    flex-shrink: 0;
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef2f6;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
}

.status-available {
    background: #e7f6eb;
    color: #246b38;
}

.status-reserved {
    background: #fff0d6;
    color: #8a5a00;
}

.status-sold {
    background: #edf0f3;
    color: #4f5964;
}

.status-expired {
    background: #f3e9e9;
    color: #8a3434;
}

.status-hidden {
    background: #ece8f7;
    color: #5b4386;
}

.my-ad-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin: 22px 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.my-ad-meta strong {
    color: var(--text);
    font-weight: 650;
}

.my-ad-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

@media (max-width: 800px) {
    .my-ad-card {
        grid-template-columns: 200px minmax(0, 1fr);
    }

    .my-ad-image,
    .my-ad-image img {
        min-height: 180px;
    }

    .my-ad-heading {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .my-ad-card {
        grid-template-columns: 1fr;
    }

    .my-ad-image {
        aspect-ratio: 4 / 3;
        min-height: 0;
    }

    .my-ad-image img {
        min-height: 0;
    }

    .my-ad-actions {
        flex-direction: column;
    }

    .my-ad-actions .button {
        width: 100%;
        text-align: center;
    }
}

/* ============================================================
   LOGOWANIE / REJESTRACJA / KONTO
   ============================================================ */

.auth-wrapper {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

.auth-card {
    width: min(100%, 520px);
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-heading {
    margin-bottom: 24px;
}

.auth-heading h1 {
    margin-bottom: 10px;
}

.auth-heading p:last-child {
    margin: 0;
    color: var(--muted);
}

.auth-form p {
    margin: 0 0 18px;
}

.auth-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 650;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
    width: 100%;
}

.auth-terms {
    margin: 4px 0 20px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.auth-terms label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-weight: 500;
    line-height: 1.5;
}

.auth-terms input[type="checkbox"] {
    width: auto;
    flex: 0 0 auto;
    margin-top: 4px;
}

.auth-terms p {
    margin: 10px 0 0;
    font-size: 0.92rem;
}

.auth-terms a {
    font-weight: 650;
}

.auth-submit {
    width: 100%;
    margin-top: 4px;
    padding: 11px 18px;
    font-weight: 700;
}

.auth-footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--muted);
}

.auth-footer a {
    margin-left: 5px;
    font-weight: 650;
}

@media (max-width: 600px) {
    .auth-wrapper {
        padding: 8px 0;
    }

    .auth-card {
        padding: 22px;
        border-radius: 10px;
    }
}

/* ============================================================
   PROFIL UŻYTKOWNIKA
   ============================================================ */

.account-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.account-card {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.account-card h2 {
    margin: 0 0 20px;
    font-size: 1.3rem;
}

.account-info-row {
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.account-info-row span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.85rem;
}

.account-info-row strong {
    font-size: 1.05rem;
}

.account-actions {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.account-actions .button {
    width: 100%;
    text-align: center;
}

.account-form p {
    margin: 0 0 18px;
}

.account-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 650;
}

.account-form input,
.account-form select,
.account-form textarea {
    width: 100%;
}

.account-form button {
    margin-top: 4px;
    min-width: 150px;
    font-weight: 700;
}

@media (max-width: 800px) {
    .account-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .account-card {
        padding: 20px;
    }

    .account-form button {
        width: 100%;
    }
}

/* ============================================================
   OBSERWOWANE OGŁOSZENIA
   ============================================================ */

.favorite-remove-form {
    margin-top: 18px;
}

.favorite-remove-form button {
    width: 100%;
}

/* ============================================================
   WIADOMOŚCI - LISTA ROZMÓW
   ============================================================ */

.conversation-list {
    display: grid;
    gap: 14px;
}

.conversation-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--text);
}

.conversation-card:hover {
    border-color: #b8c8d6;
    text-decoration: none;
}

.conversation-card-main h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
}

.conversation-card-main p {
    margin: 0;
    color: var(--muted);
}

.conversation-card-date {
    flex-shrink: 0;
    text-align: right;
}

.conversation-card-date span {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 0.8rem;
}

.conversation-card-date strong {
    font-size: 0.9rem;
}

@media (max-width: 650px) {
    .conversation-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .conversation-card-date {
        text-align: left;
    }
}

/* ============================================================
   WIADOMOŚCI - ROZMOWA
   ============================================================ */

.conversation-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.conversation-header h1 {
    margin-bottom: 6px;
}

.message-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.message-row {
    display: flex;
    justify-content: flex-start;
}

.message-row-own {
    justify-content: flex-end;
}

.message-bubble {
    width: min(78%, 720px);
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f4f7fa;
}

.message-row-own .message-bubble {
    border-color: #b9d8f0;
    background: #eaf4fc;
}

.message-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 8px;
    font-size: 0.82rem;
}

.message-meta span {
    color: var(--muted);
}

.message-text {
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.conversation-empty {
    padding: 30px;
    color: var(--muted);
    text-align: center;
}

.message-compose {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.message-compose h2 {
    margin: 0 0 18px;
    font-size: 1.3rem;
}

.message-form p {
    margin: 0 0 16px;
}

.message-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 650;
}

.message-form textarea,
.message-form input {
    width: 100%;
}

.message-form textarea {
    min-height: 130px;
    resize: vertical;
}

.message-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 650px) {
    .conversation-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .message-thread,
    .message-compose {
        padding: 18px;
    }

    .message-bubble {
        width: 92%;
    }

    .message-form-actions {
        flex-direction: column;
    }

    .message-form-actions button,
    .message-form-actions .button {
        width: 100%;
        text-align: center;
    }
}

/* ============================================================
   MODERACJA - LISTA ZGŁOSZEŃ
   ============================================================ */

.report-list {
    display: grid;
    gap: 18px;
}

.report-card {
    padding: 24px;
    margin: 0;
}

.report-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.report-card-header h2 {
    margin: 0 0 4px;
    font-size: 1.3rem;
}

.report-card-header h2 a {
    color: var(--text);
}

.report-date {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.report-status {
    flex-shrink: 0;
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef2f6;
    font-size: 0.8rem;
    font-weight: 700;
}

.report-status-new,
.report-status-pending {
    background: #fff0d6;
    color: #8a5a00;
}

.report-status-reviewed {
    background: #e7f1fb;
    color: #245f8d;
}

.report-status-closed {
    background: #e7f6eb;
    color: #246b38;
}

.report-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.report-info-item {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.report-info-item span,
.report-description > span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 650;
}

.report-description {
    padding: 16px;
    margin-bottom: 18px;
    border-left: 3px solid var(--primary);
    background: #f8fafc;
}

.report-description p {
    margin: 0;
    line-height: 1.6;
}

.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.report-actions form {
    margin: 0;
}

@media (max-width: 650px) {
    .report-card-header {
        flex-direction: column;
    }

    .report-info-grid {
        grid-template-columns: 1fr;
    }

    .report-actions {
        flex-direction: column;
    }

    .report-actions form,
    .report-actions button,
    .report-actions .button {
        width: 100%;
        text-align: center;
    }
}

/* ============================================================
   STATYSTYKI OGŁOSZENIA
   ============================================================ */

.stats-section {
    padding: 26px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}

.stat-card span {
    display: block;
    min-height: 42px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 650;
}

.stat-card strong {
    display: block;
    font-size: 1.8rem;
    line-height: 1;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.stats-table {
    min-width: 720px;
}

.stats-table th,
.stats-table td {
    white-space: nowrap;
}

.stats-table tbody tr:hover {
    background: #f8fafc;
}

@media (max-width: 1000px) {
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .stats-section {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card span {
        min-height: 0;
    }
}

/* ============================================================
   STATYSTYKI ADMINISTRACYJNE
   ============================================================ */

.admin-count-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 1100px) {
    .admin-count-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .admin-count-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .admin-count-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   PŁATNOŚCI - PROMOWANIE OGŁOSZENIA
   ============================================================ */

.promotion-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 22px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.promotion-summary > div {
    padding: 14px;
    border-radius: 8px;
    background: #f8fafc;
}

.promotion-summary span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.85rem;
}

.promotion-summary strong {
    display: block;
    font-size: 1.05rem;
}

@media (max-width: 650px) {
    .promotion-summary {
        grid-template-columns: 1fr;
        padding: 18px;
    }
}

/* ============================================================
   PŁATNOŚCI - STATUS TRANSAKCJI
   ============================================================ */

.payment-result-wrapper {
    display: flex;
    justify-content: center;
    padding: 30px 0;
}

.payment-result-card {
    width: min(100%, 680px);
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
}

.payment-result-card h1 {
    margin-bottom: 12px;
}

.payment-result-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 800;
}

.payment-result-success {
    background: #e7f6eb;
    color: #246b38;
}

.payment-result-pending {
    background: #fff0d6;
    color: #8a5a00;
}

.payment-result-error {
    background: #fff0f0;
    color: #9b2828;
}

.payment-result-neutral {
    background: #eef2f6;
    color: #4f5964;
}

.payment-result-message {
    max-width: 540px;
    margin: 0 auto 26px;
    color: var(--muted);
    line-height: 1.65;
}

.payment-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
    text-align: left;
}

.payment-details > div {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.payment-details span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.82rem;
}

.payment-details strong {
    display: block;
}

.payment-result-actions {
    margin-top: 26px;
}

@media (max-width: 650px) {
    .payment-result-card {
        padding: 22px;
    }

    .payment-details {
        grid-template-columns: 1fr;
    }

    .payment-result-actions .button {
        width: 100%;
        text-align: center;
    }
}


/* ============================================================
   PORADNIK
   ============================================================ */

.guide-heading {
    margin-bottom: 24px;
}

.guide-intro-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 28px;
}

.guide-card {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.guide-card h2 {
    margin: 4px 0 10px;
}

.guide-card > p:not(.section-kicker) {
    color: var(--muted);
}

.guide-link-list {
    padding: 0;
    margin: 20px 0 0;
    list-style: none;
}

.guide-link-list li {
    border-top: 1px solid var(--border);
}

.guide-link-list a {
    display: block;
    padding: 11px 0;
    font-weight: 650;
}

.guide-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 28px 0 38px;
    padding: 24px 26px;
    border: 1px solid #cfe2f3;
    border-radius: var(--radius);
    background: #eef7ff;
}

.guide-cta strong {
    font-size: 1.2rem;
}

.guide-cta p {
    margin: 5px 0 0;
    color: var(--muted);
}

.guide-cta-actions {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    gap: 10px;
}

.guide-content {
    display: grid;
    gap: 22px;
}

.guide-section {
    scroll-margin-top: 24px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.guide-section h2 {
    margin: 4px 0 16px;
}

.guide-section p {
    max-width: 900px;
}

.guide-section ul {
    max-width: 900px;
    padding-left: 22px;
}

.guide-section li {
    margin: 7px 0;
}

.guide-note {
    margin-top: 28px;
    padding: 18px 20px;
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    background: #eef7ff;
}

.guide-bottom-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}


@media (max-width: 800px) {

    .guide-intro-grid {
        grid-template-columns: 1fr;
    }

    .guide-cta {
        align-items: flex-start;
        flex-direction: column;
    }

    .guide-cta-actions {
        flex-shrink: 1;
    }
}


@media (max-width: 600px) {

    .guide-card,
    .guide-section {
        padding: 20px;
    }

    .guide-cta {
        padding: 20px;
    }

    .guide-cta-actions,
    .guide-bottom-actions {
        width: 100%;
    }

    .guide-cta-actions .button,
    .guide-bottom-actions .button {
        width: 100%;
        text-align: center;
    }
}


/* ============================================================
   ARTYKULY PORADNIKA
   ============================================================ */

.guide-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 9px;
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 0.9rem;
}

.guide-article {
    max-width: 960px;
    padding: 34px;
    margin: 0 auto;
}

.guide-article-header {
    margin-bottom: 28px;
}

.guide-article-header h1 {
    max-width: 850px;
    margin-bottom: 16px;
}

.guide-article-lead {
    max-width: 850px;
    margin: 0;
    color: var(--muted);
    font-size: 1.12rem;
    line-height: 1.7;
}

.guide-toc {
    margin: 28px 0 38px;
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #f8fafc;
}

.guide-toc strong {
    display: block;
    margin-bottom: 10px;
}

.guide-toc ol {
    margin: 0;
    padding-left: 23px;
}

.guide-toc li {
    margin: 7px 0;
}

.guide-article section {
    scroll-margin-top: 24px;
    margin: 0 0 42px;
}

.guide-article section h2 {
    margin: 0 0 16px;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.guide-article section p,
.guide-article section ul {
    max-width: 850px;
}

.guide-article section p {
    line-height: 1.7;
}

.guide-article section li {
    margin: 8px 0;
}

.guide-warning {
    max-width: 850px;
    margin-top: 22px;
    padding: 18px 20px;
    border-left: 4px solid #d97706;
    border-radius: 6px;
    background: #fff8e8;
}

.guide-warning p {
    margin-bottom: 0;
}

.guide-summary {
    padding: 24px;
    border-radius: var(--radius);
    background: #eef7ff;
}

.guide-article-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 34px;
    padding: 24px;
    border: 1px solid #cfe2f3;
    border-radius: var(--radius);
    background: #eef7ff;
}

.guide-article-cta strong {
    font-size: 1.18rem;
}

.guide-article-cta p {
    margin: 5px 0 0;
    color: var(--muted);
}

.guide-article-disclaimer {
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}


@media (max-width: 700px) {

    .guide-article {
        padding: 22px 18px;
    }

    .guide-article-cta {
        align-items: flex-start;
        flex-direction: column;
    }

    .guide-article-cta .guide-cta-actions {
        width: 100%;
    }

    .guide-article-cta .button {
        width: 100%;
        text-align: center;
    }
}
