h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}


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

body {
    font-family: 'Segoe UI', sans-serif;
    background: #f9f7f4;
    color: #1a1a1a;
}

/* ── Navbar ── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #2d6a4f;
    padding: 0.75rem 2rem;
}

.navbar-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 700;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

    .navbar-links a {
        color: rgba(255,255,255,0.85);
        text-decoration: none;
        font-size: 0.9rem;
        font-weight: 500;
        transition: color 0.2s;
    }

        .navbar-links a:hover {
            color: white;
        }

/* ── Main content ── */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ── Browse page ── */
.browse-heading {
    margin-bottom: 1.5rem;
    color: #2d6a4f;
}

.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.listing-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .listing-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    }

    .listing-card h3 {
        color: #1a1a1a;
        margin-bottom: 0.5rem;
    }

    .listing-card p {
        color: #6b7280;
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

.empty-message {
    color: #6b7280;
    font-size: 1rem;
    text-align: center;
    margin-top: 3rem;
}

/* ── Browse controls ── */
.browse-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input {
    padding: 0.6rem 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 50px;
    font-size: 0.95rem;
    width: 100%;
    max-width: 400px;
    outline: none;
}

    .search-input:focus {
        border-color: #2d6a4f;
    }

.filter-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chip {
    padding: 0.3rem 0.85rem;
    border-radius: 50px;
    border: 1.5px solid #e5e7eb;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.18s;
}

    .chip:hover {
        border-color: #2d6a4f;
        color: #2d6a4f;
    }

    .chip.active {
        background: #2d6a4f;
        border-color: #2d6a4f;
        color: white;
    }

.results-count {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

/* ── Listing Detail ── */
.detail-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.back-link {
    display: inline-block;
    color: #2d6a4f;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    transition: opacity 0.15s;
}

    .back-link:hover {
        opacity: 0.75;
    }

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

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

/* Image column */
.detail-image-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-main-image {
    width: 100%;
    border-radius: 14px;
    object-fit: cover;
    aspect-ratio: 4/3;
    border: 1px solid #e5e7eb;
}

.detail-image-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 14px;
    background: #f0f4f1;
    border: 2px dashed #c8d9d2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.placeholder-icon {
    font-size: 4rem;
}

.placeholder-label {
    font-size: 0.85rem;
    color: #9ca3af;
}

.detail-thumbnails {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: border-color 0.15s;
}

    .detail-thumb:hover,
    .detail-thumb.thumb-active {
        border-color: #2d6a4f;
    }

/* Info column */
.detail-info-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-badge {
    display: inline-block;
    background: #e8f5ee;
    color: #2d6a4f;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: fit-content;
}

.detail-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.25;
}

.detail-breed {
    color: #6b7280;
    font-size: 1rem;
    margin-top: -0.5rem;
}

.detail-price-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-price {
    font-size: 2rem;
    font-weight: 700;
    color: #2d6a4f;
}

.detail-quantity {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Sections */
.detail-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.detail-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.detail-description {
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Seller card */
.detail-seller-card {
    background: #f9f7f4;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.seller-farm-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a1a;
}

.seller-location {
    font-size: 0.88rem;
    color: #6b7280;
}

.seller-farm-desc {
    font-size: 0.88rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Meta row */
.detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #9ca3af;
}

.detail-status {
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
}

.status-active {
    background: #dcfce7;
    color: #16a34a;
}

.status-inactive {
    background: #fee2e2;
    color: #dc2626;
}

/* Actions */
.detail-actions {
    margin-top: 0.5rem;
}

.btn-contact {
    display: inline-block;
    background: #2d6a4f;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s;
}

    .btn-contact:hover {
        background: #245a42;
    }

/* Loading / Not Found */
.detail-loading,
.detail-not-found {
    max-width: 1100px;
    margin: 4rem auto;
    padding: 0 1.5rem;
    text-align: center;
    color: #6b7280;
}

.detail-not-found h2 {
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.btn-back {
    display: inline-block;
    margin-top: 1.25rem;
    color: #2d6a4f;
    font-weight: 600;
    text-decoration: none;
}

/* ── Post Listing page ── */
.post-page {
    max-width: 780px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.post-header {
    margin-bottom: 1.75rem;
}

.post-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d6a4f;
    margin-bottom: 0.3rem;
}

.post-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
}

.post-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.post-form-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Form sections */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #f0f0f0;
}

    .form-section:last-of-type {
        border-bottom: none;
        margin-bottom: 0;
    }

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1.25rem;
}

.form-hint {
    font-size: 0.82rem;
    color: #9ca3af;
    margin-bottom: 1rem;
    margin-top: -0.75rem;
}

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

.form-row.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 560px) {
    .form-row.two-col {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

    .form-group.full-width {
        width: 100%;
    }

    .form-group label {
        font-size: 0.85rem;
        font-weight: 600;
        color: #374151;
    }

.required {
    color: #dc2626;
}

.form-input {
    padding: 0.55rem 0.85rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1a1a1a;
    background: #fafafa;
    width: 100%;
    transition: border-color 0.15s;
    font-family: inherit;
}

    .form-input:focus {
        outline: none;
        border-color: #2d6a4f;
        background: white;
    }

    .form-input.textarea {
        resize: vertical;
        min-height: 100px;
    }

.input-prefix-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 0.85rem;
    color: #6b7280;
    font-size: 0.95rem;
    pointer-events: none;
}

.form-input.prefixed {
    padding-left: 1.75rem;
}

.field-error {
    font-size: 0.78rem;
    color: #dc2626;
}

/* Upload zone */
.upload-zone {
    position: relative;
    border: 2px dashed #c8d9d2;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: #f9faf9;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 1rem;
}

    .upload-zone.dragging {
        border-color: #2d6a4f;
        background: #e8f5ee;
    }

.upload-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
    cursor: pointer;
}

.upload-icon {
    font-size: 2.2rem;
}

.upload-text {
    font-size: 0.9rem;
    color: #6b7280;
}

    .upload-text u {
        color: #2d6a4f;
    }

/* Preview grid */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.preview-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.55);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
}

    .preview-remove:hover {
        background: rgba(220,38,38,0.85);
    }

.preview-name {
    display: block;
    font-size: 0.7rem;
    color: #6b7280;
    padding: 0.2rem 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: white;
}

/* Form actions */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
}

.btn-cancel {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    transition: background 0.15s;
}

    .btn-cancel:hover {
        background: #f3f4f6;
    }

.btn-submit {
    background: #2d6a4f;
    color: white;
    border: none;
    padding: 0.7rem 2rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn-submit:hover:not(:disabled) {
        background: #245a42;
    }

    .btn-submit:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }
