/* PrimeNest - global stylesheet */

:root {
    --color-navy-dark: #0f2a47;
    --color-navy-border: #22405f;
    --color-blue-primary: #1b5fa8;
    --color-blue-light: #8ecdfd;
    --color-red-primary: #a32e32;
    --color-red-accent: #c9484c;
    --color-text-muted: #8fa3b8;
    --color-success: #2f855a;
    --color-warning: #b7791f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1a1a1a;
}

h1, h2, h3 {
    margin: 0 0 0.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: #1a1a1a;
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.4rem;
}

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

a:hover {
    color: var(--color-red-accent);
}

@media (max-width: 640px) {
    h1 {
        font-size: 1.5rem;
    }
}

/* ---------- Buttons (shared across every panel) ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border: 1px solid #d7dde3;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
    border-color: var(--color-blue-primary);
    color: var(--color-blue-primary);
}

.btn--primary {
    background: var(--color-red-accent);
    border-color: var(--color-red-accent);
    color: #fff;
}

.btn--primary:hover {
    background: var(--color-red-primary);
    border-color: var(--color-red-primary);
    color: #fff;
}

.btn--secondary {
    background: #fff;
    border: 1px solid var(--color-blue-primary);
    color: var(--color-blue-primary);
}

.btn--secondary:hover {
    background: var(--color-blue-primary);
    color: #fff;
}

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

/* ---------- Form fields (shared across every panel) ---------- */

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field select,
.form-field textarea {
    font: inherit;
    font-weight: 400;
    font-size: 0.95rem;
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #d7dde3;
    border-radius: 8px;
    color: #1a1a1a;
    background: #fff;
}

/* Checkboxes/radios don't want the text-input treatment above — either as a
   standalone toggle (.form-field--check) or nested inside a .form-field that's
   really a radio/checkbox GROUP (furnishing, contact choice). */
.form-field input[type="checkbox"],
.form-field input[type="radio"] {
    width: auto;
    accent-color: var(--color-blue-primary);
}

.form-field--check {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--color-blue-primary);
    box-shadow: 0 0 0 3px rgba(27, 95, 168, 0.15);
}

.form-field small {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Pairs two related fields on one row; collapses to single-column on phones
   where two inputs side by side would be too cramped to use. */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-field {
    flex: 1;
    min-width: 0;
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Password visibility toggle — replaces the browser's inconsistent native
   reveal icon (Edge/Chromium's ::-ms-reveal) with one we control everywhere. */

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

.form-field__password {
    position: relative;
}

.form-field__password input {
    padding-right: 2.75rem;
}

.form-field__password-toggle {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    padding: 0;
    background-color: var(--color-text-muted);
    border: none;
    cursor: pointer;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 18px;
    mask-size: 18px;
}

.form-field__password-toggle:hover {
    background-color: var(--color-blue-primary);
}

.form-field__password-toggle.is-visible {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.9 17.9A10.4 10.4 0 0 1 12 20c-7 0-11-8-11-8a18.7 18.7 0 0 1 5.1-5.9M9.9 4.2A10.6 10.6 0 0 1 12 4c7 0 11 8 11 8a18.7 18.7 0 0 1-2.2 3.2M14.1 14.1a3 3 0 1 1-4.2-4.2'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.9 17.9A10.4 10.4 0 0 1 12 20c-7 0-11-8-11-8a18.7 18.7 0 0 1 5.1-5.9M9.9 4.2A10.6 10.6 0 0 1 12 4c7 0 11 8 11 8a18.7 18.7 0 0 1-2.2 3.2M14.1 14.1a3 3 0 1 1-4.2-4.2'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
}

.form-group {
    border: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.form-group + .form-group {
    padding-top: 1.5rem;
    border-top: 1px solid #eef1f4;
}

.form-group legend {
    width: 100%;
    padding: 0 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.form-group__note {
    margin: -0.5rem 0 1rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

/* ---------- Flash / validation messages (shared across every panel) ---------- */

.flash {
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border-left: 4px solid transparent;
    font-size: 0.9rem;
}

.flash--error {
    background: #fdecea;
    border-left-color: var(--color-red-primary);
    color: #7a1f22;
}

.flash--success {
    background: #eaf7ee;
    border-left-color: var(--color-success);
    color: #1e5631;
}

.flash--info {
    background: #eaf1fa;
    border-left-color: var(--color-blue-primary);
    color: var(--color-blue-primary);
}

.form-errors {
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem 0.75rem 1.5rem;
    border-radius: 6px;
    background: #fdecea;
    border-left: 4px solid var(--color-red-primary);
    color: #7a1f22;
    font-size: 0.9rem;
}

.form-errors li {
    margin: 0.15rem 0;
}

/* ---------- Status badges (shared across every panel) ----------
   Only the variant(s) actually in use today are styled; more badge--*
   values already exist unstyled elsewhere and get their color when the
   page that uses them is styled, not guessed in advance. */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge--pending,
.badge--pending_review,
.badge--paused {
    background: #fef3d6;
    color: var(--color-warning);
}

.badge--active {
    background: #e6f4ea;
    color: var(--color-success);
}

.badge--rejected {
    background: #fdecea;
    color: var(--color-red-primary);
}

.badge--draft,
.badge--sold,
.badge--rented,
.badge--archived {
    background: #eef1f4;
    color: var(--color-text-muted);
}

