:root {
  --marciana-red: #c8282e;
  --marciana-red-dark: #9a1e23;
  --marciana-red-darker: #73161a;
  --marciana-gold: #b89b5e;
  --marciana-cream: #f7f3e9;
  --marciana-sand: #e8dfc7;
  --ink: #222222;
  --muted: #66615a;
  --error: #b00020;
  --ok: #1c6b3a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: var(--marciana-cream);
  min-height: 100%;
}

/* Portale registrazione (tablet) — sfondo foto biblioteca con overlay */
body.portal {
  min-height: 100vh;
  background:
    linear-gradient(rgba(20, 14, 12, 0.55), rgba(20, 14, 12, 0.75)),
    url('/assets/img/library-bg.jpg') center/cover no-repeat fixed;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

/* HEADER con logo Marciana */
.hdr {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 20px;
  background: #ffffff;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}

.hdr .logo {
  max-width: 320px;
  width: 100%;
  height: auto;
  display: block;
}

.hdr-alt {
  background: var(--marciana-red);
  color: #fff;
  text-align: center;
  padding: 14px 20px;
  font-family: Georgia, serif;
  letter-spacing: .5px;
}
.hdr-alt h1 { margin: 0; font-size: 19px; font-weight: normal; }
.hdr-alt p  { margin: 4px 0 0; font-size: 13px; opacity: .92; }

/* Contenuto principale */
.main {
  background: #ffffff;
  border-radius: 0 0 6px 6px;
  padding: 28px;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}

.intro p {
  margin: 0 0 22px;
  font-size: 16px;
  line-height: 1.55;
}

/* Card form */
.card {
  background: var(--marciana-cream);
  border: 1px solid var(--marciana-sand);
  padding: 24px;
  border-radius: 4px;
}

.row { margin-bottom: 18px; }
.row label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--marciana-red);
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.row label span[aria-hidden] {
  color: var(--error);
  margin-left: 2px;
  text-transform: none;
}

.row input[type="text"],
.row input[type="email"],
.row input[type="password"] {
  width: 100%;
  font-family: inherit;
  font-size: 17px;
  padding: 13px 14px;
  border: 1px solid #c2b593;
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.row input:focus {
  border-color: var(--marciana-red);
  box-shadow: 0 0 0 3px rgba(200,40,46,.18);
}

.row.check label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
.row.check input[type="checkbox"] {
  width: 20px; height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--marciana-red);
}
.row.check a { color: var(--marciana-red); font-weight: bold; }

/* Honeypot */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Bottoni */
.actions { text-align: right; margin-top: 22px; }
.actions.center { text-align: center; }
button, .btn {
  background: var(--marciana-red);
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  padding: 13px 28px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: .5px;
  text-decoration: none;
  display: inline-block;
  transition: background .12s, transform .06s;
}
button:hover, .btn:hover { background: var(--marciana-red-dark); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Feedback */
.feedback {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 3px;
  font-size: 14px;
  display: none;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.feedback.show { display: block; }
.feedback.ok  { background: #e2f0e6; color: var(--ok); border: 1px solid #b9dac6; }
.feedback.err { background: #fde7e9; color: var(--error); border: 1px solid #f1b8be; }

/* Footer */
.foot {
  text-align: center;
  margin-top: 22px;
  font-size: 13px;
  color: rgba(255,255,255,.88);
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
body:not(.portal) .foot { color: var(--muted); text-shadow: none; }
.foot a { color: inherit; text-decoration: underline; }

/* Card "success" */
.card.ok { text-align: center; padding: 32px 24px; }
.card.ok .ok-icon {
  width: 64px; height: 64px;
  background: var(--ok); color: #fff;
  font-size: 32px; line-height: 64px;
  border-radius: 50%;
  margin: 0 auto 16px;
  box-shadow: 0 2px 8px rgba(28,107,58,.3);
}
.card.ok h2 { color: var(--marciana-red); margin: 0 0 12px; font-family: Georgia, serif; font-size: 22px; }
.card.ok p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Pagina privacy */
.card.text { background: #fff; border: none; padding: 0; }
.card.text h2 {
  color: var(--marciana-red);
  margin: 22px 0 8px;
  font-size: 18px;
  font-family: Georgia, serif;
}
.card.text h2:first-child { margin-top: 0; }
.card.text ul { margin: 0 0 14px; padding-left: 22px; line-height: 1.6; }
.card.text p { line-height: 1.6; margin: 0 0 10px; }

/* Tablet portrait 10" (e mobile) */
@media (max-width: 820px) {
  .page { padding: 16px 12px 32px; }
  .hdr { padding: 16px; }
  .hdr .logo { max-width: 260px; }
  .main { padding: 18px; }
  .row input[type="text"],
  .row input[type="email"],
  .row input[type="password"] { font-size: 16px; padding: 12px; }
  button, .btn { width: 100%; padding: 14px 20px; }
}

/* Evita zoom iOS su focus input < 16px */
@media screen and (-webkit-min-device-pixel-ratio:0) {
  input, select, textarea { font-size: 16px; }
}
