/* ============================================
   North Eye — base styles
   Light, clean palette. Mobile-first, then scales up.
   ============================================ */

:root {
    --color-bg: #f7f9fb;
    --color-surface: #ffffff;
    --color-border: #e3e8ee;
    --color-text: #263140;
    --color-text-muted: #6b7785;
    --color-primary: #2f8ce0;
    --color-primary-dark: #1f6fb8;
    --color-accent: #ffb03b;
    --color-success-bg: #e6f7ec;
    --color-success-text: #1a7a41;
    --color-error-bg: #fdeaea;
    --color-error-text: #c0392b;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(20, 30, 45, 0.08), 0 1px 2px rgba(20, 30, 45, 0.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}

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

/* ---- Header ---- */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 20px;
}
.site-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}
.brand:hover { text-decoration: none; }
.main-nav a {
    margin-left: 18px;
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.95rem;
}
.main-nav a:first-child { margin-left: 0; }
.main-nav a:hover { color: var(--color-primary); text-decoration: none; }

/* ---- Main content area ---- */
.site-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* ---- Footer ---- */
.site-footer {
    text-align: center;
    padding: 20px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* ---- Flash messages ---- */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.flash-success { background: var(--color-success-bg); color: var(--color-success-text); }
.flash-error { background: var(--color-error-bg); color: var(--color-error-text); }

/* ---- Cards / forms ---- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}
.form-narrow {
    max-width: 440px;
    margin: 0 auto;
}
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--color-text);
}
.form-group .hint {
    display: block;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--color-bg);
    color: var(--color-text);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-surface);
}
.field-error {
    color: var(--color-error-text);
    font-size: 0.82rem;
    margin-top: 5px;
}

/* Client-side validation: highlight the whole field row in red instead of
   ever submitting/reloading the page over something like a missing file
   or a mismatched password confirmation. */
.form-group.has-error label {
    color: var(--color-error-text);
}
.form-group.has-error input,
.form-group.has-error textarea {
    border-color: var(--color-error-text);
    background: var(--color-error-bg);
}
.form-group.has-error .js-field-error {
    display: block;
}
.js-field-error {
    display: none;
    color: var(--color-error-text);
    font-size: 0.82rem;
    margin-top: 5px;
}

/* Password field with show/hide toggle */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--color-primary);
    padding: 4px 6px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 11px 22px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); text-decoration: none; }
.btn-block { width: 100%; }

.form-footer-link {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

h1, h2, h3 { color: var(--color-text); }
h1 { font-size: 1.6rem; }

/* ---- Responsive: tablet and up ---- */
@media (min-width: 640px) {
    .site-main { padding: 32px 20px 80px; }
    h1 { font-size: 1.9rem; }
}

/* ---- Responsive: desktop ---- */
@media (min-width: 960px) {
    .card { padding: 36px; }
}

/* ---- Simple grid for listings (used from Phase 3 onward) ---- */
.listing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
@media (min-width: 640px) {
    .listing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
    .listing-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Listing cards ---- */
.listing-card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.listing-card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--color-bg);
    overflow: hidden;
}
.listing-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.listing-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}
.listing-card-body {
    padding: 14px 16px 16px;
}
.listing-card-body h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}
.listing-card-meta {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    gap: 8px;
}
.listing-card-price {
    margin: 0;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-text);
}
.listing-card-price span {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}
.badge-premium {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-luxury {
    background: #fff4e0;
    color: #8a5a00;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}
