:root {
  --holidu-blue: #00809D;
  --holidu-blue-light: #E0FAFF;
  --holidu-blue-hover: #024251;
  --color-cta: #FF6064;
  --color-cta-active: #FF3A3D;
  --holidu-green: #33782B;
  --holidu-green-light: #D7EED7;
  --holidu-yellow: #FFC107;
  --holidu-yellow-light: #FFF4D1;
  --color-danger: #DC3545;
  --text-color: #2D2D28;
  --color-white: #FFFFFF;
  --holidu-grey-ultra-light: #F7F5F3;
  --holidu-grey-medium: #CCCCCC;
  --holidu-grey-dark: #605C57;
  --color-border: #CED4DA;
  --color-secondary: #6C757D;
  --border-radius-md: 6px;
  --border-radius-lg: 12px;
  --header-height: 64px;
  --font-family: "Inter", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  /* dvh tracks the visible area under iOS Safari's toolbars; 100% is the fallback */
  height: 100dvh;
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-color);
  background: var(--holidu-grey-ultra-light);
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

/* App header: the single Holidu Blue band */
.app-header {
  flex: 0 0 auto;
  height: calc(var(--header-height) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
  background: var(--holidu-blue);
  color: var(--color-white);
  display: flex;
  align-items: center;
}
.app-header__slot { flex: 0 0 auto; display: flex; min-width: 48px; }
.app-header__slot--end { justify-content: flex-end; }
.app-header__title { flex: 1; margin: 0; text-align: center; font-size: 18px; font-weight: 700; line-height: 20px; }

.icon-button {
  background: transparent;
  border: 0;
  color: inherit;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease-in-out;
}
.icon-button:active { background: rgba(0, 0, 0, 0.25); }
.icon-button svg { width: 26px; height: 26px; fill: currentColor; }
.icon-button[aria-pressed="true"] { color: var(--holidu-yellow); }

/* Main / views */
.app-main { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.view { flex: 1 1 auto; display: flex; flex-direction: column; padding: 16px; }
.view--centered { align-items: center; justify-content: center; color: var(--holidu-grey-dark); }

/* Login */
.login { width: 100%; max-width: 420px; color: var(--text-color); }
.login__title { font-size: 28px; font-weight: 700; margin: 0 0 4px; }
.login__subtitle { margin: 0 0 24px; color: var(--holidu-grey-dark); }
.field { display: block; margin-bottom: 16px; }
.field__label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.form-control {
  width: 100%;
  font: inherit;
  font-weight: 500;
  line-height: 24px;
  color: var(--text-color);
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  background: var(--color-white);
}
.form-control:focus { outline: none; border-color: var(--holidu-blue); box-shadow: 0 0 0 2px var(--holidu-blue-light); }
.form-error { color: var(--color-danger); font-size: 14px; margin: -4px 0 12px; }

/* Buttons: red CTA, outline for secondary actions */
.btn {
  font: inherit;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: var(--border-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s ease-in-out, color 0.15s ease-in-out;
}
.btn:focus-visible, .icon-button:focus-visible, .switch input:focus-visible + .switch__track {
  outline: none;
  box-shadow: 0 0 0 3px var(--holidu-blue-light), 0 0 0 5px var(--holidu-blue);
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-block { width: 100%; }
.btn-lg { font-size: 18px; font-weight: 700; min-height: 56px; }
.btn-primary { background: var(--color-cta); border-color: var(--color-cta); color: var(--color-white); }
.btn-primary:not(:disabled):active { background: var(--color-cta-active); border-color: var(--color-cta-active); }
.btn-outline-primary { background: transparent; border-color: var(--color-cta); color: var(--color-cta); }
.btn-outline-primary:not(:disabled):active { background: var(--color-cta); color: var(--color-white); }
.btn-outline-light { background: transparent; border-color: var(--color-white); color: var(--color-white); }
.btn-outline-light:not(:disabled):active { background: rgba(255, 255, 255, 0.2); }

/* Home */
.home__scan { max-width: 420px; }
.home__hint { margin: 16px 0 0; font-size: 14px; text-align: center; }

/* Badges */
.badge { display: inline-block; padding: 4px 10px; border-radius: 50px; font-size: 12px; font-weight: 700; line-height: 16px; }
.badge-warning { background: var(--holidu-yellow); color: var(--text-color); }

/* Switch: checked = Holidu Green */
.switch { position: relative; display: inline-flex; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { position: relative; width: 50px; height: 30px; border-radius: 15px; background: var(--holidu-grey-medium); transition: background 0.15s ease-in-out; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--color-white); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s ease-in-out; }
.switch input:checked + .switch__track { background: var(--holidu-green); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }

/* Settings */
.view--settings { padding: 16px 0; gap: 16px; }
.settings-group { background: var(--color-white); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.settings-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; cursor: pointer; }
.settings-row--stacked { flex-wrap: wrap; justify-content: flex-end; cursor: default; }
.settings-row__text { flex: 1 1 100%; margin: 0; font-size: 18px; word-break: break-word; }
.settings-row__action { flex: 0 0 auto; min-width: 50%; }
.settings-row__icon { width: 28px; height: 28px; fill: var(--holidu-grey-dark); flex: 0 0 auto; }
.settings-row__label { flex: 1 1 auto; font-size: 18px; font-weight: 500; }
.settings-group__description { margin: 0; padding: 10px 16px 12px; font-size: 14px; color: var(--holidu-grey-dark); background: var(--holidu-grey-ultra-light); }
.settings-version { margin: auto 0 0; padding: 0 16px; text-align: center; font-size: 12px; color: var(--holidu-grey-dark); }

@media (min-width: 600px) {
  :root { --header-height: 72px; }
  .view--settings { padding: 24px; }
  .settings-group { border: 1px solid var(--color-border); border-radius: var(--border-radius-lg); overflow: hidden; max-width: 560px; width: 100%; margin: 0 auto; }
}
