/**
 * Shared Horse Trailer Marketplace UI primitives.
 */

/* ---- Buttons ---- */

.ht-button {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    background: #f0f0f1;
    color: #1d2327;
    box-sizing: border-box;
}

.ht-button:hover,
.ht-button:focus-visible {
    background: #e2e4e7;
    color: #1d2327;
}

.ht-button--primary {
    background: #007cba;
    color: #fff;
}

.ht-button--primary:hover,
.ht-button--primary:focus-visible {
    background: #006ba1;
    color: #fff;
}

.ht-button--secondary {
    background: #fff;
    border-color: #007cba;
    color: #007cba;
}

.ht-button--secondary:hover,
.ht-button--secondary:focus-visible {
    background: #f0f8ff;
    color: #006ba1;
}

.ht-button--danger {
    background: #fff;
    border-color: #d63638;
    color: #d63638;
}

.ht-button--danger:hover,
.ht-button--danger:focus-visible {
    background: #fcf0f1;
    color: #b32d2e;
}

.ht-button--small {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
}

/* ---- Notices ---- */

.ht-notice {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
}

.ht-notice--error,
.ht-trailer-upload-error {
    color: #8a1f1f;
    background: #fdecec;
    border-color: #f5c2c2;
}

.ht-trailer-upload-error[hidden] {
    display: none !important;
}

.ht-notice--success {
    color: #1e602e;
    background: #edf9f0;
    border-color: #b7e0c2;
}

.ht-notice--warning {
    color: #6b4f00;
    background: #fff8e5;
    border-color: #f0dba6;
}

.ht-notice--info {
    color: #1e4e72;
    background: #f0f8ff;
    border-color: #b8dff5;
}

.ht-notice__link {
    font-weight: 600;
}

.ht-notice[hidden] {
    display: none !important;
}

/* ---- Form primitives (scoped under .ht-form) ---- */

.ht-form .ht-form-section {
    margin: 0 0 28px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.ht-form .ht-form-section legend {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding: 0;
}

.ht-form .ht-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ht-form .ht-form-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 16px;
}

.ht-form .ht-form-group label:not(.ht-checkbox) {
    display: block;
    width: 100%;
    margin-bottom: 6px;
    font-weight: 500;
    float: none;
}

.ht-form .ht-form-group input[type="text"],
.ht-form .ht-form-group input[type="email"],
.ht-form .ht-form-group input[type="password"],
.ht-form .ht-form-group input[type="url"],
.ht-form .ht-form-group input[type="number"],
.ht-form .ht-form-group input[type="file"],
.ht-form .ht-form-group select,
.ht-form .ht-form-group textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    float: none;
}

.ht-form .ht-form-help {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #666;
}

.ht-form .ht-form-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

.ht-form .ht-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.ht-form .ht-checkbox-group {
    margin-bottom: 8px;
}

.ht-form .ht-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    margin: 0;
    font-weight: 400;
    cursor: pointer;
}

.ht-link-highlight {
    color: #007cba;
    font-weight: 600;
    text-decoration: none;
}

.ht-link-highlight:hover {
    text-decoration: underline;
}

/* ---- Access denied / empty state ---- */

.ht-access-denied {
    padding: 40px;
    text-align: center;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ht-access-denied h3 {
    margin-top: 0;
    color: #333;
}

.ht-access-denied--login {
    border-left: 4px solid #007cba;
}

.ht-access-denied--vendor {
    border-left: 4px solid #f0b849;
}

.ht-empty-state {
    padding: 40px 20px;
    text-align: center;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 8px;
}

.ht-empty-state__icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.ht-empty-state__message {
    margin: 0 0 16px;
    color: #555;
}

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