/* eVisitor – Adriatic coastal UI */
:root {
  --sea: #0a3d4a;
  --sea-deep: #062a33;
  --azure: #1b7a8a;
  --foam: #eef4f5;
  --mist: #d5e4e8;
  --ink: #142428;
  --muted: #5a6f75;
  --line: rgba(10, 61, 74, 0.12);
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --accent: #c45c3a;
  --accent-hover: #a84b2e;
  --ok: #1f8a5a;
  --danger: #b33a3a;
  --shadow: 0 18px 50px rgba(6, 42, 51, 0.12);
  --radius: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--foam);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
a { color: inherit; }

/* Atmosphere */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(27, 122, 138, 0.28), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(196, 92, 58, 0.12), transparent 50%),
    linear-gradient(165deg, #dfecee 0%, #eef4f5 42%, #e7eef0 100%);
  animation: atmosphere-drift 18s ease-in-out infinite alternate;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40' viewBox='0 0 120 40'%3E%3Cpath d='M0 20c20-12 40-12 60 0s40 12 60 0' fill='none' stroke='%230a3d4a' stroke-opacity='0.08' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 120px 40px;
  pointer-events: none;
}

@keyframes atmosphere-drift {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(8deg); }
}

.shell {
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3.5rem;
  position: relative;
  animation: rise-in 0.7s var(--ease) both;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-link {
  position: absolute;
  top: 1.4rem;
  right: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--sea);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  backdrop-filter: blur(8px);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
  text-decoration: none;
}

.admin-link:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: var(--shadow);
}

/* Hero */
.hero {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--sea);
  line-height: 1;
  animation: brand-in 0.9s var(--ease) both;
}

@keyframes brand-in {
  from { opacity: 0; letter-spacing: 0.08em; transform: translateY(8px); }
  to { opacity: 1; letter-spacing: -0.03em; transform: translateY(0); }
}

.hero h1 {
  margin: 0.65rem 0 0.35rem;
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  font-weight: 600;
  color: var(--ink);
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* Language */
.lang {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin: 1.6rem 0 1.4rem;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 600 0.78rem/1 var(--font-body);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease), color 0.2s;
}

.lang-btn:hover { transform: translateY(-1px); border-color: var(--azure); }
.lang-btn.active {
  background: var(--sea);
  border-color: var(--sea);
  color: #fff;
}

.flag-icon {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
}

/* Progress */
.progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 auto 1.5rem;
  width: min(280px, 100%);
}

.progress-step {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--mist);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
  transition: background 0.3s, color 0.3s, transform 0.3s var(--ease);
}

.progress-step.active {
  background: var(--sea);
  color: #fff;
  transform: scale(1.08);
}

.progress-step.done {
  background: var(--azure);
  color: #fff;
}

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--mist);
  margin: 0 0.35rem;
}

/* Panels / forms */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.35rem 1.5rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: panel-in 0.45s var(--ease) both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel h2 {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--sea);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.field { display: flex; flex-direction: column; gap: 0.35rem; }

.field label,
.guest-card .form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

input[type="date"],
input[type="number"],
input[type="text"],
input[type="password"],
select,
textarea,
.form-control,
.form-select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
  color: var(--ink);
  font: 500 0.95rem/1.3 var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--azure);
  box-shadow: 0 0 0 3px rgba(27, 122, 138, 0.18);
}

textarea { min-height: 88px; resize: vertical; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.35rem;
  font: 600 0.95rem/1 var(--font-body);
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, box-shadow 0.2s;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--sea);
  color: #fff;
  box-shadow: 0 8px 20px rgba(10, 61, 74, 0.22);
}
.btn-primary:hover { background: var(--sea-deep); }

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(196, 92, 58, 0.28);
}
.btn-accent:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--sea);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(10, 61, 74, 0.05); }

/* Guest cards */
.guest-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.guest-card-title {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--sea);
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.mb-2 { margin-bottom: 0; }

.eu-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0.2rem 0 0.95rem;
}

.eu-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.eu-option:hover { border-color: var(--azure); }
.eu-option.selected {
  border-color: var(--sea);
  background: rgba(27, 122, 138, 0.08);
  box-shadow: 0 0 0 3px rgba(27, 122, 138, 0.12);
}

.status-icon { width: 22px; height: auto; }

/* Preview */
.preview {
  font-size: 0.95rem;
  line-height: 1.55;
}
.preview h6 {
  margin: 1rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--sea);
}
.preview p { margin: 0.2rem 0; }
.preview hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0.9rem 0;
}

/* Info / QR */
.info-strip {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.2rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
}

.info-copy h3 {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--sea);
}
.info-copy p {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.privacy-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--azure);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.info-strip img {
  border-radius: 10px;
  flex-shrink: 0;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
}
.login-page .atmosphere { z-index: 0; }
.login-container {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  animation: rise-in 0.65s var(--ease) both;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem 1.6rem 1.6rem;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.login-header { text-align: center; margin-bottom: 1.5rem; }
.lock-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.9rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sea);
  color: #fff;
}
.login-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--sea);
}
.login-header .subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.mb-3 { margin-bottom: 1rem; }
.password-wrapper .input-group { position: relative; }
.toggle-password {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.4rem;
  cursor: pointer;
}
.w-100 { width: 100%; }
.mt-3 { margin-top: 1rem; }
.alert {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 0.9rem;
}
.alert-danger {
  background: rgba(179, 58, 58, 0.1);
  color: var(--danger);
  border: 1px solid rgba(179, 58, 58, 0.25);
}
.security-info {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.45rem;
}
.security-item {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.78rem;
  color: var(--muted);
}
.security-item svg { flex-shrink: 0; margin-top: 1px; color: var(--azure); }
.login-footer {
  text-align: center;
  margin-top: 1.2rem;
}
.login-footer a {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--sea);
  text-decoration: none;
}
.login-footer a:hover { text-decoration: underline; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(20px);
  background: var(--sea);
  color: #fff;
  padding: 0.85rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
  z-index: 100;
  max-width: calc(100% - 2rem);
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error { background: var(--danger); }

.lang a.lang-btn { text-decoration: none; color: inherit; }
.actions a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

.privacy-panel h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--sea);
}

@media (max-width: 720px) {
  .field-grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .eu-selector { grid-template-columns: 1fr; }
  .actions .btn { flex: 1 1 auto; text-align: center; }
  .info-strip { flex-direction: column; text-align: center; }
  .shell { width: min(100% - 1.25rem, 760px); padding-top: 1.25rem; }
}
