/* ================================================
   ATLAS CLAIMS TOOLKIT - STYLES
   Brand palette matched to atlasnevada.com
   ================================================ */

:root {
    --atlas-navy: #0A1628;
    --atlas-navy-2: #0F1F38;
    --atlas-navy-3: #152B4A;
    --atlas-dark: #060D18;
    --atlas-blue: #2F7FFF;
    --atlas-blue-hover: #4A92FF;
    --atlas-blue-soft: rgba(47, 127, 255, 0.12);
    --atlas-border: rgba(255, 255, 255, 0.08);
    --atlas-border-strong: rgba(255, 255, 255, 0.14);
    --text-primary: #FFFFFF;
    --text-secondary: #C5CFDD;
    --text-muted: #7A8699;
    --success: #34D399;
    --warning: #FBBF24;
    --danger: #F87171;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--atlas-dark);
    background-image:
        radial-gradient(ellipse at top left, rgba(47, 127, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(47, 127, 255, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, var(--atlas-dark) 0%, #040810 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.hidden { display: none !important; }

/* -------- HEADER -------- */
.header {
    background: rgba(10, 22, 40, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--atlas-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}
.logo {
    height: 42px;
    width: auto;
}
.toolkit-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--atlas-blue);
    padding-left: 14px;
    border-left: 1px solid var(--atlas-border-strong);
}
.badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 6px 12px;
    border: 1px solid var(--atlas-border-strong);
    border-radius: 20px;
}

/* -------- MAIN -------- */
.main {
    padding: 48px 0 80px;
    min-height: calc(100vh - 140px);
}

/* -------- HERO -------- */
.hero {
    margin-bottom: 40px;
}
.hero-title {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.05;
    margin-bottom: 12px;
}
.accent {
    color: var(--atlas-blue);
}
.hero-sub {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 620px;
    margin-bottom: 28px;
}

/* -------- INPUT CARD -------- */
.input-card {
    background: rgba(10, 22, 40, 0.6);
    border: 1px solid var(--atlas-border-strong);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(10px);
}
.input-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    gap: 16px;
    align-items: end;
}
.hint-row {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--atlas-border-strong);
    text-align: center;
}
.hint-row:empty {
    display: none;
}
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.input-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}
.input-group input {
    background: rgba(6, 13, 24, 0.8);
    border: 1px solid var(--atlas-border-strong);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
}
.input-group input:focus {
    outline: none;
    border-color: var(--atlas-blue);
    box-shadow: 0 0 0 3px var(--atlas-blue-soft);
}
.input-group input::placeholder {
    color: var(--text-muted);
}
.input-group input[type="date"] {
    color-scheme: dark;
    position: relative;
}
/* Placeholder for empty date fields (native date inputs don't honor `placeholder`) */
.input-group input[type="date"]:not(:focus):invalid::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    margin-right: 6px;
}
.input-group input[type="date"]:not(:focus):invalid {
    color: transparent;
}

/* -------- BUTTONS -------- */
.btn-primary {
    background: var(--atlas-blue);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    white-space: nowrap;
}
.btn-primary:hover {
    background: var(--atlas-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(47, 127, 255, 0.3);
}
.btn-primary:active {
    transform: translateY(0);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--atlas-border-strong);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}
.btn-secondary:hover {
    background: var(--atlas-blue-soft);
    border-color: var(--atlas-blue);
    color: var(--atlas-blue);
}

/* -------- LOADING -------- */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--atlas-border-strong);
    border-top-color: var(--atlas-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------- ERROR -------- */
.error-box {
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #FCA5A5;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

/* -------- RESULTS -------- */
.results { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -------- SUMMARY BAR -------- */
.summary-bar {
    background: linear-gradient(135deg, var(--atlas-navy-2) 0%, var(--atlas-navy) 100%);
    border: 1px solid var(--atlas-border-strong);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr auto;
    gap: 24px;
    align-items: center;
}
.summary-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.summary-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

/* -------- CARDS -------- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
.card {
    background: rgba(10, 22, 40, 0.6);
    border: 1px solid var(--atlas-border-strong);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}
.card.full { margin-bottom: 24px; }
.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--atlas-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header h2 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
}
.card-header h2 .muted {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 13px;
}
.card-tag {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--atlas-blue);
    background: var(--atlas-blue-soft);
    padding: 4px 10px;
    border-radius: 20px;
}

/* -------- MAP -------- */
.map {
    width: 100%;
    height: 340px;
    background: var(--atlas-navy-3);
}

/* -------- WEATHER PANEL -------- */
.weather-panel { padding: 20px; }
.weather-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.weather-item {
    background: rgba(6, 13, 24, 0.6);
    border: 1px solid var(--atlas-border);
    border-radius: 10px;
    padding: 14px 16px;
}
.weather-item-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.weather-item-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}
.weather-item-value .unit {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 2px;
}
.weather-item.highlight {
    background: linear-gradient(135deg, rgba(47, 127, 255, 0.15), rgba(47, 127, 255, 0.05));
    border-color: rgba(47, 127, 255, 0.4);
}
.weather-item.highlight .weather-item-value {
    color: var(--atlas-blue);
}

/* -------- STORM TABLE -------- */
#storm-table-wrap { padding: 4px 8px 8px; }
.storm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.storm-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--atlas-border);
}
.storm-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--atlas-border);
    color: var(--text-secondary);
}
.storm-table tr:last-child td { border-bottom: none; }
.storm-table tr:hover td { background: rgba(47, 127, 255, 0.05); }
.event-type-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--atlas-blue-soft);
    color: var(--atlas-blue);
    border: 1px solid rgba(47, 127, 255, 0.2);
}
.event-type-pill.hail { background: rgba(251, 191, 36, 0.1); color: var(--warning); border-color: rgba(251, 191, 36, 0.2); }
.event-type-pill.wind { background: rgba(52, 211, 153, 0.1); color: var(--success); border-color: rgba(52, 211, 153, 0.2); }
.event-type-pill.tornado { background: rgba(248, 113, 113, 0.1); color: var(--danger); border-color: rgba(248, 113, 113, 0.2); }

.muted-text {
    color: var(--text-muted);
    padding: 24px;
    text-align: center;
    font-style: italic;
}

/* -------- TOOL GRID -------- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    padding: 20px;
}
.tool-card {
    background: rgba(6, 13, 24, 0.6);
    border: 1px solid var(--atlas-border);
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    display: flex;
    gap: 14px;
    align-items: center;
}
.tool-card:hover {
    border-color: var(--atlas-blue);
    background: var(--atlas-blue-soft);
    transform: translateY(-2px);
}
.tool-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--atlas-blue-soft);
    color: var(--atlas-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 700;
}
.tool-info { min-width: 0; }
.tool-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}
.tool-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* -------- FOOTER -------- */
.footer {
    border-top: 1px solid var(--atlas-border);
    padding: 24px 0;
    background: rgba(6, 13, 24, 0.6);
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}
.footer-muted { color: var(--text-muted); }

/* -------- RESPONSIVE -------- */
@media (max-width: 900px) {
    .hero-title { font-size: 36px; }
    .input-row { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .summary-bar { grid-template-columns: 1fr; gap: 14px; }
    .weather-grid { grid-template-columns: 1fr 1fr; }
}

/* -------- EMAIL PACKET CARD -------- */
.summary-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.jurisdiction-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    white-space: nowrap;
}
.jurisdiction-badge.lic-licensed {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.10);
    border-color: rgba(74, 222, 128, 0.35);
}
.jurisdiction-badge.lic-na {
    color: #93c5fd;
    background: rgba(147, 197, 253, 0.10);
    border-color: rgba(147, 197, 253, 0.35);
}
.jurisdiction-badge.lic-out {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.10);
    border-color: rgba(251, 191, 36, 0.35);
}
.email-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px 20px;
}
.email-form textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(6, 13, 24, 0.6);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 70px;
}
.email-form textarea:focus {
    outline: none;
    border-color: var(--atlas-blue);
    background: rgba(6, 13, 24, 0.85);
}
.email-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.email-feedback {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
    min-height: 18px;
}
.email-feedback.success { color: #4ade80; }
.email-feedback.error { color: #f87171; }
.card-tag.warn {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.08);
}

/* -------- ADDRESS AUTOCOMPLETE -------- */
.address-wrap { position: relative; width: 100%; }
.address-wrap input { width: 100%; box-sizing: border-box; }
.input-group input { width: 100%; box-sizing: border-box; }
.address-suggest {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 6px;
    background: #0d1a2e;
    border: 1px solid var(--atlas-border);
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
    max-height: 280px;
    overflow-y: auto;
}
.address-suggest li {
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13.5px;
    cursor: pointer;
    line-height: 1.35;
}
.address-suggest li:hover,
.address-suggest li.active {
    background: rgba(47, 127, 255, 0.18);
    color: #fff;
}

/* Google Places dropdown styling to match dark theme */
.pac-container {
    background: #0d1a2e;
    border: 1px solid var(--atlas-border);
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
    margin-top: 4px;
    font-family: inherit;
}
.pac-item {
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
}
.pac-item:first-child { border-top: none; }
.pac-item:hover, .pac-item-selected {
    background: rgba(47, 127, 255, 0.18);
}
.pac-item-query, .pac-matched { color: #fff; }
.pac-icon { display: none; }

.weather-item-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.02em;
}

/* -------- SEVERITY BANNER -------- */
.severity-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 16px;
    border-radius: 12px;
    border: 1px solid;
    background: rgba(255,255,255,0.02);
    flex-wrap: wrap;
}
.severity-headline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.severity-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.severity-tag {
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0,0,0,0.25);
    border: 1px solid currentColor;
}
.severity-low      { color: #facc15; border-color: rgba(250, 204, 21, 0.4); background: rgba(250, 204, 21, 0.06); }
.severity-high     { color: #fb923c; border-color: rgba(251, 146, 60, 0.5); background: rgba(251, 146, 60, 0.08); }
.severity-severe   { color: #f87171; border-color: rgba(248, 113, 113, 0.55); background: rgba(248, 113, 113, 0.10); }
.severity-extreme  { color: #f43f5e; border-color: rgba(244, 63, 94, 0.65); background: rgba(244, 63, 94, 0.13); }
.sev-low      { color: #facc15; }
.sev-high     { color: #fb923c; }
.sev-severe   { color: #f87171; }
.sev-extreme  { color: #f43f5e; }

/* -------- LEAFLET MAP CONTAINER -------- */
.leaflet-container {
    background: #0d1a2e;
    font-family: inherit;
    border-radius: inherit;
}
.leaflet-control-attribution {
    background: rgba(6, 13, 24, 0.7) !important;
    color: var(--text-muted) !important;
    font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--atlas-blue) !important; }

/* -------- MAP LEGEND & MISC -------- */
.map-legend {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-top: 1px solid var(--atlas-border);
    font-size: 11.5px;
    color: var(--text-secondary);
}
.legend-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    border: 1px solid rgba(10, 22, 40, 0.6);
    vertical-align: middle;
}
.legend-note { color: var(--text-muted); margin-left: auto; font-style: italic; }
.field-hint {
    font-size: 11px;
    color: var(--atlas-blue);
    margin-top: 6px;
    line-height: 1.5;
}
.field-hint .hint-label {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-right: 4px;
}
.field-hint .hint-city { white-space: nowrap; margin: 0 4px; }
.field-hint .hint-city strong { color: var(--text-secondary, #cbd5e1); font-weight: 600; }
.field-hint .hint-date {
    color: var(--atlas-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    margin: 0 2px;
}
.field-hint .hint-date:hover { color: #fff; }
.field-hint .hint-evt { color: var(--text-muted); }
.field-hint .hint-loading { color: var(--text-muted); font-style: italic; }
.same-day-pill {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 600;
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(248, 113, 113, 0.12);
    border-radius: 999px;
    vertical-align: middle;
}
