*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, #0c1624 0, #050810 40%, #02040a 100%);
    color: #f5f5f5;
}

#ui-root {
    position: relative;
    width: 100%;
    height: 100%;
}

#map {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Glassy cards */

.glass {
    background: radial-gradient(circle at top left, rgba(255,255,255,0.16), rgba(5,8,16,0.9));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
      0 24px 60px rgba(0,0,0,0.55),
      0 0 0 1px rgba(255,255,255,0.02);
}

/* Top card */

.top-card {
    position: absolute;
    left: 50%;
    top: 14px;
    transform: translateX(-50%);
    z-index: 10;
    width: min(960px, calc(100% - 24px));
    padding: 12px 16px 10px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-column-gap: 18px;
    grid-row-gap: 6px;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand .dot {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #53ffd0, #24c06f 40%, #00c1ff 110%);
    box-shadow: 0 0 18px rgba(0,193,255,0.8);
}

.logo-text {
    font-weight: 650;
    letter-spacing: 0.02em;
    font-size: 18px;
}

.inputs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.field-group label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    opacity: 0.75;
}

.field-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.field-row input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(3,7,14,0.7);
    color: #f5f5f5;
    padding: 6px 10px;
    font-size: 13px;
    outline: none;
}

.field-row input::placeholder {
    color: rgba(230,230,230,0.5);
}

.field-row input:focus {
    border-color: #24c06f;
    box-shadow: 0 0 0 1px rgba(36,192,111,0.5);
}

.actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
}

.auth-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-status {
    font-size: 11px;
    opacity: 0.8;
}

.status-text {
    font-size: 11px;
    opacity: 0.8;
    text-align: right;
}

/* Buttons */

.primary-btn {
    border-radius: 999px;
    border: none;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #24c06f, #00c1ff);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.primary-btn:disabled {
    opacity: 0.4;
    cursor: default;
    box-shadow: none;
}

.primary-btn:not(:disabled):hover {
    filter: brightness(1.04);
}

.pill-btn {
    border-radius: 999px;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    background: rgba(255,255,255,0.08);
    color: #f5f5f5;
}

.pill-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.18);
}

.pill-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.icon-btn {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: none;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    background: rgba(255,255,255,0.08);
    color: #f5f5f5;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Bottom sheet */

.bottom-sheet {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 9;
    width: min(480px, calc(100% - 32px));
    padding: 12px 14px 10px;
}

.bottom-sheet.hidden {
    display: none;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.sheet-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

.sheet-price {
    font-size: 16px;
    font-weight: 600;
}

.sheet-body {
    font-size: 13px;
    opacity: 0.9;
}

/* Overlay */

.overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.overlay.hidden {
    display: none;
}

.overlay-card {
    padding: 16px 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #24c06f;
    animation: spin 0.8s linear infinite;
}

.overlay-text {
    font-size: 13px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Leaflet overrides */

.leaflet-container {
    background: transparent;
}

.leaflet-control-attribution {
    background: rgba(3,8,18,0.8);
    color: #aaa;
}

/* Responsive tweaks */

@media (max-width: 720px) {
    .top-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        row-gap: 8px;
        padding: 10px 12px;
        align-items: stretch;
    }

    .actions {
        align-items: flex-start;
    }

    .status-text {
        text-align: left;
    }
}
