/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --bg:           #fffffd;
  --brand:        #0048ff;
  --error:        #C90B31;
  --text-strong:  #121c21;
  --text-weak:    rgba(18, 28, 33, 0.6);
  --border:       rgba(18, 28, 33, 0.6);
  --border-strong:#121c21;
  --font-heading: 'PP Editorial New', 'Times New Roman', serif;
  --font-body:    'Velvelyne', system-ui, sans-serif;
  --navbar-h:     65px;
  --bottom-bar-h: 65px;
  --max-w:        390px;
  --side-pad:     24px;
}

/* Font faces */
@font-face {
  font-family: 'PP Editorial New';
  src: url('fonts/PPEditorialNew-Ultralight.otf') format('opentype');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Velvelyne';
  src: url('fonts/Velvelyne-Book.woff2') format('woff2'),
       url('fonts/Velvelyne-Book.woff')  format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Velvelyne';
  src: url('fonts/Velvelyne-Regular.woff2') format('woff2'),
       url('fonts/Velvelyne-Regular.woff')  format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

html {
  height: 100%;
}

body {
  min-height: 100%;
  background: #e8e8e6;
  display: flex;
  justify-content: center;
  font-family: var(--font-body);
  color: var(--text-strong);
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

fieldset {
  border: none;
}

/* ============================================================
   Page wrapper
   ============================================================ */
.page-wrapper {
  width: 100%;
  max-width: var(--max-w);
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: var(--navbar-h);
  display: flex;
  align-items: stretch;
  background: var(--bg);
  border-bottom: 1px solid var(--border-strong);
  z-index: 200;
}

/* Home navbar: three equal language tabs */
.navbar--home .lang-tab {
  flex: 1;
}
.navbar--home .lang-tab:not(:first-child) {
  border-left: 1px solid var(--border-strong);
}

/* Form navbar: logo + three language tabs */
.navbar--form {
  justify-content: space-between;
}

.navbar-logo {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-right: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.logo-link {
  font-family: var(--font-heading);
  font-weight: 200;
  font-size: 20px;
  color: var(--text-strong);
  white-space: nowrap;
}

.navbar-langs {
  display: flex;
  flex: 1;
  align-items: stretch;
}
.navbar-langs .lang-tab {
  flex: 1;
}
.navbar-langs .lang-tab:not(:first-child) {
  border-left: 1px solid var(--border-strong);
}

.lang-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 17px 0;
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 400;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: background 0.15s;
}

.lang-tab--active {
  font-weight: 400;
}

/* ============================================================
   Home — main content
   ============================================================ */
.main-content {
  flex: 1;
  padding: calc(var(--navbar-h) + 31px) var(--side-pad) calc(var(--bottom-bar-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-title {
  font-family: var(--font-heading);
  font-weight: 200;
  font-size: 48px;
  line-height: 1;
  color: var(--text-strong);
}

.hero-desc {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.3;
  color: var(--text-strong);
}

/* Map */
.map-container {
  width: calc(100% + var(--side-pad) * 2);
  margin-left: calc(-1 * var(--side-pad));
  height: 260px;
  background: #e8e8e6;
  flex-shrink: 0;
}

/* Leaflet attribution compact */
.leaflet-control-attribution {
  font-size: 9px !important;
}

/* Activity section */
.activity-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-weak);
  letter-spacing: 0.04em;
  padding-bottom: 12px;
}

/* Stats list */
.stats-list {
  display: flex;
  flex-direction: column;
}

.stat-row {
  border: 1px solid var(--border);
  padding: 8px 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 46px;
  margin-bottom: -1px;
  transition: background 0.15s;
}

.stat-row--mappable {
  cursor: pointer;
}

.stat-row--mappable:hover {
  background: #f4f7ff;
}

.stat-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-username {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-time {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-weak);
  flex-shrink: 0;
  margin-left: 8px;
}

.stat-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.stat-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-strong);
  overflow: hidden;
}

.stat-info span {
  white-space: nowrap;
}

.stat-dot {
  width: 3px;
  height: 3px;
  background: var(--text-strong);
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.stat-mood {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-strong);
  flex-shrink: 0;
  margin-left: 8px;
}

.stats-empty {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-weak);
  padding: 16px 0;
}

.veure-tot {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-align: right;
  display: block;
  padding-top: 12px;
  cursor: pointer;
}

.veure-tot[hidden] {
  display: none;
}

/* ============================================================
   Home — bottom CTA
   ============================================================ */
.bottom-cta {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: var(--bottom-bar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  border-top: 1px solid var(--border-strong);
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 400;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  z-index: 200;
}

/* ============================================================
   Form page — content
   ============================================================ */
.form-content {
  flex: 1;
  padding: calc(var(--navbar-h) + 31px) var(--side-pad) calc(var(--bottom-bar-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-title {
  font-family: var(--font-heading);
  font-weight: 200;
  font-size: 48px;
  line-height: 1;
  color: var(--text-strong);
}

.form-subtitle {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.3;
  color: var(--text-strong);
}

.form-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Field group */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group[hidden] {
  display: none;
}

.field-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-weak);
  line-height: 1.3;
}

.field-input {
  width: 100%;
  height: 38px;
  padding: 8px 16px;
  background: #fcfcfc;
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-weak);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  transition: border-color 0.15s, color 0.15s;
}

.field-input:focus {
  border-color: var(--text-strong);
  color: var(--text-strong);
}

.field-input::placeholder {
  color: var(--text-weak);
}

.field-input.field-error {
  border-color: var(--error);
}

/* Select wrapper with custom arrow */
.field-select-wrapper {
  position: relative;
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-strong);
  font-size: 13px;
  line-height: 1;
}

/* Radio groups */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-group-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-weak);
  line-height: 1.3;
  display: block;
  margin-bottom: 8px;
}

.radio-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.radio-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border: 1px solid var(--text-strong);
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s;
}

.radio-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--text-strong);
  border-radius: 50%;
}

.radio-option.radio-error input[type="radio"] {
  border-color: var(--error);
}

.radio-label-main {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-strong);
  white-space: nowrap;
}

.radio-label-sub {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-weak);
  white-space: nowrap;
}

/* ============================================================
   Form — bottom bar
   ============================================================ */
.form-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: var(--bottom-bar-h);
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--border-strong);
  z-index: 200;
}

.form-cancel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  background: var(--bg);
  border-right: 1px solid var(--border-strong);
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 400;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.form-submit-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  border: none;
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 400;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.form-submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ============================================================
   Use-my-location button
   ============================================================ */

.use-location-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: var(--brand);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.use-location-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.use-location-btn.location-active {
  background: #f0faf4;
  border-color: #007F37;
  color: #007F37;
}

.use-location-btn.location-active::before {
  content: '✓ ';
}

.location-detected {
  margin-top: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-weak);
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-bar-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(var(--max-w) - var(--side-pad) * 2);
  background: var(--text-strong);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  padding: 12px 20px;
  z-index: 300;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.toast.toast--success {
  background: #007F37;
}

.toast.toast--error {
  background: #c0392b;
}

.toast.toast--visible {
  opacity: 1;
}

.toast.toast--fade {
  opacity: 0;
}

/* ============================================================
   Searchable select
   ============================================================ */

.searchable-select {
  position: relative;
}

.ss-trigger {
  position: relative;
}

/* Reuse .field-input on the ss-input; override padding-right for arrow */
.ss-trigger .ss-input {
  padding-right: 36px;
  cursor: default;
  caret-color: var(--text-strong);
}

.ss-trigger .select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-strong);
  font-size: 13px;
  line-height: 1;
  transition: transform 0.15s;
}

/* Dropdown list */
.ss-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-top: none;
  max-height: 220px;
  overflow-y: auto;
  z-index: 150;
  list-style: none;
  padding: 4px 0;
  margin: 0;
}

.ss-dropdown[hidden] {
  display: none;
}

.ss-dropdown li {
  padding: 9px 16px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-strong);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-dropdown li:hover,
.ss-dropdown li.ss-highlighted {
  background: rgba(18, 28, 33, 0.07);
}

.ss-dropdown li.ss-no-results {
  color: var(--text-weak);
  cursor: default;
  font-size: 14px;
}

.ss-dropdown li.ss-no-results:hover {
  background: none;
}

/* City autocomplete: two-line result */
.ss-dropdown li {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* CRITICAL: restore display:none for hidden items —
   the flex rule above overrides the browser UA display:none from [hidden] */
.ss-dropdown li[hidden] {
  display: none;
}

.ss-city-name {
  font-size: 16px;
  color: var(--text-strong);
  line-height: 1.2;
}

.ss-city-detail {
  font-size: 11px;
  color: var(--text-weak);
  line-height: 1.2;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Open state arrow */
.searchable-select.ss--open .select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* Disabled state (city before country is selected) */
.searchable-select.ss--disabled .ss-input {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.searchable-select.ss--disabled .select-arrow {
  opacity: 0.45;
}

/* Error state */
.searchable-select.ss--error .ss-trigger .ss-input {
  border-color: var(--error);
}

/* Selected state — show value in strong color */
.searchable-select.ss--selected .ss-input {
  color: var(--text-strong);
}

/* ============================================================
   Validation error banner
   ============================================================ */

.form-error-banner {
  position: fixed;
  bottom: var(--bottom-bar-h);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  background: var(--error);
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  padding: 14px var(--side-pad);
  z-index: 190;
  text-align: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.form-error-banner[hidden] {
  display: none;
}

.form-error-banner.banner--fade {
  opacity: 0;
}

/* Extra bottom padding while the error banner is showing */
.form-content.has-error-banner {
  padding-bottom: calc(var(--bottom-bar-h) + 56px + 20px);
}

