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

:root {
    --amber:      #F59E0B;
    --amber-dark: #D97706;
    --teal:       #0D9488;
    --teal-dark:  #0F766E;
    --ink:        #1C2B2B;
    --muted:      #4B5E5E;
    --soft:       #F7F4F0;
    --white:      #FFFFFF;
    --border:     #E2DDD8;

    --font-body:    'Inter', system-ui, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--white);
    line-height: 1.6;
    font-size: 1rem;
}

/* ── Typography helpers ── */
h1, h2, h3 { line-height: 1.2; }
p { color: var(--muted); }

/* ── Utility ── */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    border: none;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--amber);
    color: var(--ink);
}
.btn-primary:hover { background: var(--amber-dark); }

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.6);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); }

/* ── Nav ── */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.logo span { color: var(--amber-dark); }

.nav-cta {
    padding: 10px 22px;
    font-size: 0.9rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-login {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
}
.nav-login:hover { color: var(--teal); }

.nav-email {
    font-size: 0.85rem;
    color: var(--muted);
}

.btn-outline-dark {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--border);
    font-size: 0.9rem;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}
.btn-outline-dark:hover { border-color: var(--ink); background: var(--soft); }

/* ── Hero ── */
.hero {
    background: linear-gradient(135deg, #0c4a4a 0%, #0D9488 55%, #1a8a6a 100%);
    padding: 96px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-badge {
    display: inline-block;
    background: rgba(245, 158, 11, 0.2);
    color: #FCD34D;
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 16px;
    margin-bottom: 24px;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    color: var(--white);
    max-width: 760px;
    margin: 0 auto 20px;
}

.hero h1 em {
    color: #FCD34D;
    font-style: normal;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(255,255,255,0.82);
    max-width: 580px;
    margin: 0 auto 40px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-meta {
    margin-top: 20px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* ── How it works ── */
.how {
    padding: 88px 0;
    background: var(--soft);
}

.section-label {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 12px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    text-align: center;
    margin-bottom: 56px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
}

.step {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 28px;
    text-align: center;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--amber), var(--amber-dark));
    color: var(--ink);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.step h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* ── Features ── */
.features {
    padding: 88px 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.feature-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 28px;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 16px;
    display: block;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* ── Pricing ── */
.pricing {
    padding: 88px 0;
    background: var(--soft);
    text-align: center;
}

.price-card {
    display: inline-block;
    background: var(--white);
    border: 2px solid var(--teal);
    border-radius: 20px;
    padding: 48px 52px;
    max-width: 420px;
    width: 100%;
    position: relative;
}

.price-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--teal);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 18px;
    border-radius: 100px;
    white-space: nowrap;
}

.price-amount {
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--ink);
    line-height: 1;
    margin: 16px 0 4px;
}

.price-amount sup {
    font-size: 1.8rem;
    vertical-align: super;
    font-family: var(--font-body);
    font-weight: 700;
}

.price-label {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 32px;
}

.price-features {
    list-style: none;
    margin-bottom: 36px;
    text-align: left;
}

.price-features li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-features li:last-child { border-bottom: none; }

.check {
    color: var(--teal);
    font-weight: 700;
    flex-shrink: 0;
}

.price-card .btn { width: 100%; text-align: center; font-size: 1.05rem; padding: 16px; }

.price-note {
    margin-top: 18px;
    font-size: 0.82rem;
    color: var(--muted);
}

/* ── Footer ── */
footer {
    background: var(--ink);
    color: rgba(255,255,255,0.5);
    padding: 32px 0;
    text-align: center;
    font-size: 0.85rem;
}

footer a { color: rgba(255,255,255,0.65); text-decoration: none; }
footer a:hover { color: var(--white); }

/* ── Responsive ── */
@media (max-width: 600px) {
    .price-card { padding: 40px 28px; }
    .hero { padding: 72px 0 60px; }
}

/* ── Auth pages ── */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--soft);
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.auth-card h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink);
}

.form-hint {
    font-weight: 400;
    color: var(--muted);
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.12);
}

.form-submit {
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    font-size: 1rem;
}

.auth-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--muted);
}

.auth-switch a {
    color: var(--teal);
    font-weight: 600;
    text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .auth-card { padding: 36px 24px; }
}

/* ── Dashboard ── */
.dashboard-page {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.dashboard-layout {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.dashboard-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-justify-content: space-between;
    justify-content: space-between;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    padding: 24px 12px 12px;
}

.sidebar-logo {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--ink);
    text-decoration: none;
    padding: 0 4px;
    margin-bottom: 24px;
    display: block;
}

.sidebar-logo span { color: var(--amber-dark); }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover { background: var(--soft); color: var(--ink); }
.sidebar-link.active { background: var(--teal); color: var(--white); }

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

.sidebar-account {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s;
}

.sidebar-account:hover { background: var(--soft); }
.sidebar-account.active { background: var(--soft); }

.sidebar-account-icon {
    font-size: 0.6rem;
    color: var(--teal);
    flex-shrink: 0;
}

.sidebar-account-email {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-main {
    position: absolute;
    top: 0;
    left: 220px;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: var(--soft);
}

.map-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 140px;
}

.dashboard-header {
    padding: 20px 28px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    flex-shrink: 0;
}

.dashboard-header h1 {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.dashboard-header p {
    font-size: 0.875rem;
    margin: 0;
}

.dashboard-content {
    padding: 28px;
    overflow-y: auto;
}

/* ── Map slider ── */
.map-slider-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 20px 24px 24px;
    box-sizing: border-box;
}

.map-slider-label {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.map-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

.map-slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--teal) 0%, var(--teal) var(--val, 25%), var(--border) var(--val, 25%));
}

.map-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--teal);
    border: 3px solid var(--white);
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    margin-top: -11px;
    cursor: pointer;
}

.map-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--teal);
    border: 3px solid var(--white);
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    cursor: pointer;
}

.account-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 480px;
    overflow: hidden;
}

.account-row {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.account-row:last-child { border-bottom: none; }

.account-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted);
    width: 80px;
    flex-shrink: 0;
}

.account-value {
    font-size: 0.95rem;
    color: var(--ink);
}

#map {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.map-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-placeholder-inner {
    text-align: center;
    color: var(--muted);
}

.map-placeholder-inner p { margin-top: 12px; line-height: 1.7; }
.map-placeholder-inner code {
    background: var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ── Settings page ── */
.settings-main {
    position: absolute;
    top: 0;
    left: 220px;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    background: var(--soft);
}

.settings-scroll {
    max-width: 560px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.settings-heading {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: 28px;
    color: var(--ink);
}

.settings-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 24px 0 8px 4px;
}

.settings-section-label:first-of-type { margin-top: 0; }

.settings-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    cursor: default;
}

.settings-row.has-border { border-top: 1px solid var(--border); }

.settings-icon {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.settings-row-label {
    flex: 1;
    font-size: 0.95rem;
    color: var(--ink);
}

/* Toggle switch */
.toggle { position: relative; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }

.toggle-track {
    display: block;
    width: 48px;
    height: 28px;
    background: var(--border);
    border-radius: 999px;
    transition: background 0.2s;
    position: relative;
}

.toggle input:checked + .toggle-track { background: var(--teal); }

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.toggle input:checked + .toggle-track .toggle-thumb {
    transform: translateX(20px);
}

/* Temp rows */
.temp-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.15s;
}

.temp-row:hover { background: var(--soft); }
.temp-row.has-border { border-top: 1px solid var(--border); }

.temp-display {
    font-size: 0.95rem;
    color: var(--muted);
    font-weight: 500;
}

.temp-chevron {
    font-size: 1.2rem;
    color: var(--border);
    transition: transform 0.25s;
    line-height: 1;
}

.temp-chevron.rotated { transform: rotate(90deg); }

/* Accordion panel */
.temp-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--soft);
    border-top: 0px solid var(--border);
}

.temp-panel.open {
    max-height: 140px;
    border-top-width: 1px;
}

.temp-panel-inner {
    padding: 18px 24px 22px;
}

.temp-panel-value {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--teal);
    margin-bottom: 12px;
}

/* Map key dots */
.map-key-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-green { background: #16A34A; }
.dot-blue  { background: #2563EB; }
.dot-red   { background: #DC2626; }

/* Save button */
.settings-save-btn {
    width: 100%;
    margin-top: 28px;
    padding: 16px;
    font-size: 1rem;
}

.settings-save-msg {
    text-align: center;
    font-size: 0.875rem;
    margin-top: 12px;
    min-height: 20px;
}

.settings-save-msg.msg-ok  { color: #16A34A; }
.settings-save-msg.msg-err { color: #DC2626; }
