/* style.css - Look of the whole site.
   Part A: the site frame (header, lists, buttons, the blanks page) - calm, simple, professional.
   Part B: the paper blanks - they must look exactly like the paper forms.
   Part C: printing. */

/* ===================== A. Site frame ===================== */
:root {
  --paper-w: 1034px;   /* width of a blank on the screen: the SAME on the blanks page and the printout */
  --blue: #9fc5e8; --dark: #1f4e79; --line: #111;      /* paper colours (used by the blanks) */
  --ink: #1d2733; --muted: #5f6b7a; --border: #d9e0e8; --bg: #eef2f6; --card: #fff;
  --brand: #1f4e79; --brand-hover: #173c5e;
  --ok: #1e7b3c; --ok-bg: #e7f5ec; --todo: #9a5b00; --todo-bg: #fff4dc; --danger: #b42318; --danger-bg: #fdecea;
  --c-amfi: #1f4e79; --c-student: #b5761b; --c-tutor: #c0392b;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; font-family: "Segoe UI", Calibri, system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg); }
h1 { font-size: 1.6rem; margin: 0 0 .3rem; color: var(--ink); font-weight: 650; }
a { color: var(--brand); }
.muted { color: var(--muted); font-size: .9rem; }
.inline { display: inline; }
code { background: #f3f5f8; padding: .1rem .3rem; word-break: break-all; font-size: .8rem; }

/* header */
.site-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.5rem; padding: 0 1.5rem; height: 60px;
  background: #fff; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand img { height: 38px; width: auto; display: block; }
.brand span { font-weight: 650; font-size: 1rem; line-height: 1.1; }
.brand small { display: block; font-weight: 400; font-size: .72rem; color: var(--muted); }
.main-nav { display: flex; gap: .3rem; flex: 1; }
.main-nav a { padding: .45rem .8rem; text-decoration: none; color: var(--muted); font-weight: 600; border-radius: 6px; }
.main-nav a:hover { background: var(--bg); color: var(--ink); }
.main-nav a.on { color: var(--brand); background: #e6eef6; }
.user-box { display: flex; align-items: center; gap: .6rem; margin-left: auto; font-size: .88rem; }
.user-name { color: var(--muted); }
.role-tag { color: #fff; font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 4px; letter-spacing: .02em; }
.role-amfi { background: var(--c-amfi); }
.role-student { background: var(--c-student); } .role-tutor { background: var(--c-tutor); }

/* page */
.page { max-width: calc(var(--paper-w) + 4rem + 2px); margin: 1.5rem auto 3rem; padding: 1.6rem 2rem; background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; }
.page-head p { margin: .2rem 0 0; }
.count { font-size: .75rem; background: var(--bg); color: var(--muted); padding: .05rem .5rem; border-radius: 10px; }
.narrow { max-width: 560px; }
.back-link { display: inline-block; margin-bottom: .6rem; text-decoration: none; font-weight: 600; font-size: .9rem; }

/* messages */
.flash { max-width: 1100px; margin: 1rem auto 0; padding: 0 1rem; }
.msg { margin: 0 0 .4rem; padding: .6rem 1rem; border-radius: 8px; background: var(--ok-bg); color: var(--ok); border: 1px solid #b7e0c4; }
.msg.error { background: var(--danger-bg); color: var(--danger); border-color: #f5c2bd; }
.msg.info, .msg.warning { background: var(--todo-bg); color: var(--todo); border-color: #f2d89c; }

/* buttons */
.btn, button { display: inline-block; background: var(--brand); color: #fff; border: 1px solid transparent; padding: .5rem 1rem; border-radius: 6px;
  cursor: pointer; font: inherit; font-weight: 600; text-decoration: none; line-height: 1.3; text-align: center; }
.btn:hover, button:hover { background: var(--brand-hover); }
.btn.secondary, button.secondary { background: #fff; color: var(--ink); border-color: var(--border); }
.btn.secondary:hover { background: var(--bg); }
.btn.danger, button.danger { background: var(--danger); color: #fff; }
.btn.ghost-danger { background: #fff; color: var(--danger); border-color: #f0c4bf; }
.btn.ghost-danger:hover { background: var(--danger-bg); }
.btn.small { padding: .28rem .65rem; font-size: .85rem; }
.btn.block { display: block; width: 100%; }
.linkbtn { background: none; color: var(--brand); padding: 0; border: 0; text-decoration: underline; font-weight: 600; }
.linkbtn:hover { background: none; }
button:disabled { background: #aab4bf; cursor: not-allowed; }

/* forms */
.card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 1.2rem 1.4rem; margin: 1rem 0; }
.form label, .box label { display: block; margin: .8rem 0 .25rem; font-weight: 600; font-size: .9rem; }
.form input[type=text], .form input[type=email], .form select, .box input[type=text], .box input[type=email], .box input[type=password], .box select {
  width: 100%; padding: .55rem .7rem; font: inherit; border: 1px solid #c4ced9; border-radius: 6px; background: #fff; }
.form input:focus, .form select:focus, .box input:focus { outline: 2px solid #8fb4dd; border-color: var(--brand); }
.form .two { display: flex; gap: .5rem; }
.form .two > * { flex: 1; }
.form-actions { display: flex; gap: .5rem; margin-top: 1.2rem; flex-wrap: wrap; }
.danger-card { border-color: #f0c4bf; background: #fffafa; }
.box { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 1.2rem 1.4rem; margin: 1rem 0; }
.errorlist { color: var(--danger); list-style: none; padding: 0; margin: .2rem 0; font-size: .85rem; }
.login-logo { display: block; width: 200px; max-width: 70%; margin: .5rem auto 1rem; }

/* lists */
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f7f9fb; font-weight: 600; }
table.list th, table.list td { padding: .65rem .8rem; border-bottom: 1px solid #edf0f3; vertical-align: middle; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: #fafcfe; }
table.list .strong { font-weight: 650; text-decoration: none; }
table.list .strong:hover { text-decoration: underline; }
td.now { font-size: .85rem; color: var(--muted); max-width: 260px; }
td.now.ok { color: var(--ok); font-weight: 600; }
.pill { display: inline-block; font-size: .8rem; font-weight: 600; padding: .12rem .55rem; border-radius: 10px; }
.pill.new { background: var(--todo-bg); color: var(--todo); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }

/* ===== The blanks page: menu left, one sheet right ===== */
.page-desk { max-width: none; margin: 0; padding: 0; background: none; border: 0; border-radius: 0; }
.desk { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.desk-side { position: sticky; top: 60px; align-self: start; height: calc(100vh - 60px); overflow-y: auto; background: #fff;
  border-right: 1px solid var(--border); padding: 1.2rem 1rem; display: flex; flex-direction: column; gap: 1rem; }
.side-back { font-size: .85rem; font-weight: 600; text-decoration: none; display: block; margin-bottom: .5rem; }
.side-student b { display: block; font-size: 1.1rem; }
.side-student span { display: block; font-size: .85rem; color: var(--muted); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; gap: .65rem; align-items: center; padding: .55rem .6rem; border-radius: 8px; text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.side-nav a:hover { background: var(--bg); }
.side-nav a.on { background: #e6eef6; border-color: #c9d9ea; }
.side-nav .ic { flex: 0 0 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700;
  background: #eef1f4; color: #7b8896; }
.side-nav .t { display: flex; flex-direction: column; min-width: 0; }
.side-nav .t b { font-size: .9rem; font-weight: 600; }
.side-nav .t small { font-size: .78rem; color: var(--muted); }
.side-nav .st-done .ic { background: var(--ok); color: #fff; }
.side-nav .st-todo .ic { background: var(--todo); color: #fff; }
.side-nav .st-todo .t small { color: var(--todo); font-weight: 600; }
.side-nav .st-locked .ic { background: #f3f4f6; font-size: .75rem; }
.side-tools { display: flex; flex-direction: column; gap: .4rem; margin-top: auto; }
.side-links { font-size: .82rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.side-links summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.side-links p { margin: .5rem 0; }
.side-links small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }

.desk-main { padding: 1.2rem 1.2rem 3rem; min-width: 0; }
.next-step { max-width: var(--paper-w); margin: 0 auto 1.2rem; display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border-radius: 10px;
  background: #fff; border: 1px solid var(--border); }
.next-step p { margin: 0; flex: 1; font-weight: 600; }
.next-step p small { display: block; font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--todo); }
.next-step .ic { flex: 0 0 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: #eef1f4; color: var(--muted); }
.next-step.step-todo { background: var(--todo-bg); border-color: #f2d89c; }
.next-step.step-todo .ic { background: var(--todo); color: #fff; }
.next-step.step-done { background: var(--ok-bg); border-color: #b7e0c4; color: var(--ok); }
.next-step.step-done .ic { background: var(--ok); color: #fff; }
.next-step.step-wait p { font-weight: 400; color: var(--muted); }

.desk-sec { max-width: var(--paper-w); margin: 0 auto 2.5rem; }
.desk.js .desk-sec { display: none; }
.desk.js .desk-sec.open { display: block; }
.sec-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .7rem; }
.sec-head h2 { margin: 0; font-size: 1.15rem; flex: 1 1 auto; }
.sec-head .who { font-size: .82rem; color: var(--muted); }
.badge { font-size: .76rem; font-weight: 700; padding: .2rem .6rem; border-radius: 10px; }
.badge-edit { background: var(--ok-bg); color: var(--ok); }
.badge-view { background: #eef1f4; color: var(--muted); }
.sec-save { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin: .8rem 0 0; position: sticky; bottom: 0;
  padding: .7rem 0; background: linear-gradient(transparent, var(--bg) 35%); }
.sec-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.sec-nav a { text-decoration: none; font-weight: 600; font-size: .9rem; }

/* the sheet on the desk = exactly the same frame, margins and font as a page of the printout (.print-page) */
.sheet { width: 100%; margin: 0 0 1.2rem; padding: 1rem 1.4rem; background: #fff; color: var(--ink);
  border: 1px solid #d5dde5; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.08); overflow-x: auto; }
.sheet .blank-head { margin-top: 0; }
.sheet-empty { margin: 1rem 0; text-align: center; font-size: 1.1rem; color: #8a9aab; }
.sheet-later { min-height: 0; padding: 3rem 2rem; display: flex; flex-direction: column; align-items: center; background: #fafbfc; border: 2px dashed #d3dbe4; box-shadow: none; }
.sheet-later .lock { font-size: 2rem; opacity: .6; }
.checklist { margin: .5rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: .9rem; }
.week-bar { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin: -.6rem 0 1rem; padding: .45rem .7rem;
  background: #f7f9fb; border: 1px dashed #d3dbe4; font-family: "Segoe UI", system-ui, sans-serif; font-size: .88rem; }
.week-bar form { margin: 0; display: flex; gap: .4rem; }
.sign-box { display: flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer; padding: .3rem; background: #f1f6fc; border: 1px solid #cfdcec; border-radius: 4px; }
.sign-box input { width: 1.15rem; height: 1.15rem; margin: 0; cursor: pointer; }
.sign-box span { color: #8a9aab; }
.sign-box input:checked + span { color: #111; }
.week-bar button { padding: .3rem .8rem; font-size: .85rem; }

/* comments under a week (not printed) */
.comments { margin: -.5rem 0 1.4rem; font-family: "Segoe UI", system-ui, sans-serif; font-size: .88rem; }
.comment { background: #fff8e1; border-left: 3px solid #f0b429; padding: .45rem .8rem; margin: .3rem 0; }
.comment.tutor { background: #fdf0ee; border-left-color: var(--c-tutor); }
.comments form { display: flex; gap: .5rem; align-items: flex-start; margin-top: .3rem; }
.comments textarea { flex: 1; padding: .45rem; font: inherit; border: 1px solid #c4ced9; border-radius: 6px; min-height: 2.4rem; }
.comments button { padding: .35rem .8rem; font-size: .85rem; }
.comment-new summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .85rem; }
.week-anchor { scroll-margin-top: 80px; }

@media (max-width: 900px) {
  .site-head { gap: .8rem; padding: 0 1rem; }
  .brand span { display: none; }
  .user-name { display: none; }
  .page { margin: 0; border-radius: 0; border-width: 0 0 1px; padding: 1.2rem 1rem; }
  .flash { padding: 0 1rem; }
  .page-head { flex-direction: column; }
  .desk { display: block; }
  .desk-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: .8rem 1rem; gap: .6rem; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: .3rem; }
  .side-nav a { flex: 0 0 auto; padding: .4rem .55rem; }
  .side-nav .t small { display: none; }
  .side-tools { flex-direction: row; flex-wrap: wrap; }
  .side-tools .btn.block { width: auto; flex: 1; }
  .desk-main { padding: 1rem 1rem 2rem; }
  .sheet { padding: .8rem .8rem; }
  .sheet .eu-flag { width: 54px; height: 36px; }
  .sheet .erasmus { font-size: 1.5rem; margin-left: 0; }
  .sheet .amfi-logo, .sheet .ana-head .amfi-logo { height: 46px; }
  .sheet .ana-erasmus { font-size: 1.5rem; }
  .sheet .ana-title, .sheet .blank-title { font-size: 1.25rem; }
}

/* ===================== B. Paper blanks (look like the paper forms) ===================== */
/* blank header */
.blank-head { display: flex; align-items: center; justify-content: space-between; margin: 1rem 0 .5rem; }
.eu-flag { width: 90px; height: 60px; }
.erasmus { font-size: 2.4rem; color: var(--dark); margin-left: -3rem; }
.erasmus span { font-weight: 700; }
.amfi { font-size: 1.8rem; font-weight: 800; color: var(--dark); text-align: right; line-height: 1; }
.amfi small { display: block; font-size: .7rem; font-weight: 400; }
.blank-title { text-align: center; color: var(--dark); font-size: 1.6rem; margin: .5rem 0 1rem; }

/* blank table */
table.blank { width: 100%; border-collapse: collapse; border: 2px solid var(--line); margin-bottom: 1.2rem; }
.blank th, .blank td { border: 1px solid var(--line); padding: 0; vertical-align: middle; }
.blank td.label, .blank td.txt, .blank td.center { padding: .45rem .6rem; }
.blank td.label { width: 48%; font-size: .95rem; }
.blank td.center { text-align: center; }
.blank td.tasks { padding: .5rem; vertical-align: top; }
.blank th.hd { background: var(--blue); color: var(--dark); font-weight: 600; padding: .45rem .6rem; text-align: center; }
.blank input[type=text], .blank input[type=number], .blank input[type=date], .blank select, .blank textarea {
  width: 100%; border: 0; background: transparent; font: inherit; padding: .45rem .6rem; text-align: center; }
.blank textarea { text-align: left; resize: vertical; }
.blank input:focus, .blank select:focus, .blank textarea:focus { outline: 2px solid #1f6feb; background: #fffbe6; }
.blank ol { margin: .5rem 0; padding-left: 2rem; font-size: .9rem; }
.blank ol li { margin-bottom: .35rem; }

/* weekly table */
.weektable td { height: 2.6rem; }
.weektable .col-week { width: 11%; }

/* ratings table */
.grid th.num, .grid td.cell { width: 5.2%; text-align: center; }
.grid td.cell label { display: block; cursor: pointer; padding: .55rem 0; }
.grid td.cell input[type=radio] { transform: scale(1.3); }
.tick { font-weight: 700; color: var(--dark); }
.sign-row { display: flex; justify-content: space-between; margin: 1.5rem 0; }
.sign-row input[type=date] { border: 0; border-bottom: 1px solid var(--line); font: inherit; }

/* a table is not cut between 2 pages when a single blank is printed from the desk */
.blank, .weektable { break-inside: avoid; }

/* Printout polish: sheet look on screen, compact A4 layout in print */
.print-status { border: 1px solid; border-radius: 6px; padding: .8rem 1rem; margin: 1rem 0; }
.print-status.ok { background: #e6f4ea; border-color: #81c995; }
.print-status.warn { background: #fff8e1; border-color: #f0b429; }
.print-status ul { margin: .4rem 0 .6rem 1.2rem; padding: 0; }
.print-status p { margin: .4rem 0 0; }
.print-status a { margin-left: .8rem; color: var(--dark); font-weight: 600; }
button:disabled { background: #aaa; cursor: not-allowed; }
.draft-stamp { display: none; }
.slim-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--dark); color: var(--dark); padding-bottom: .3rem; margin-bottom: .8rem; }
.slim-head span { color: #555; font-size: .85rem; }
/* Hints in empty blank fields */
.blank input::placeholder, .blank textarea::placeholder, .box input::placeholder { color: #9aa5b1; font-style: italic; }

/* Print the blue header cells even when "Background graphics" is off in the print dialog */
.print-all { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* Anagrafica (first blank) and Certificate (last blank) */
.schedule th.hd, .schedule td { font-size: .85rem; padding: .35rem; }
.certificate { text-align: center; line-height: 1.5; }
.certificate .big { font-size: 1.4rem; font-weight: 700; margin: .6rem 0; }
.certificate hr { border: 0; border-top: 1px solid #999; margin: .5rem 0 1.5rem; }
.cert-sign { text-align: left; margin-top: 3rem; }

/* Anagrafica: same look as the paper blank */
.anagrafica { font-family: Georgia, "Times New Roman", serif; color: #1a1a1a; }
.anagrafica i { font-style: normal; color: #2a5d9f; }
.ana-head { display: flex; justify-content: space-between; align-items: center; }
.ana-erasmus { display: flex; align-items: center; gap: .8rem; font-family: Calibri, "Segoe UI", sans-serif; font-size: 2.6rem; color: #2f4f6f; }
.ana-title { text-align: center; color: #2f4f6f; font-size: 2rem; line-height: 1.15; margin: 1rem 0 .4rem; letter-spacing: .02em; }
.ana-table { width: 100%; border-collapse: collapse; border: 1.5px solid #222; margin-bottom: .8rem; }
.ana-table td { border: 1px solid #222; padding: .4rem .6rem; vertical-align: middle; }
.ana-table td.l { width: 52%; font-weight: 700; font-size: .95rem; }
.ana-table td.v { text-align: center; font-weight: 700; }
.ana-sub { font-weight: 700; font-size: .95rem; margin: 1.4rem 0 .4rem; }
.ana-schedule { width: 100%; border-collapse: collapse; border: 1.5px solid #222; margin-bottom: 1.2rem; table-layout: fixed; }
.ana-schedule th, .ana-schedule td { border: 1px solid #222; text-align: center; padding: .35rem .2rem; font-size: .8rem; }
.ana-schedule th { background: #a9cdea; color: #3d5c7a; font-weight: 600; }
.ana-schedule td { height: 3.4rem; font-weight: 700; }
.ana-insurance td.l { font-size: 1rem; }
.ana-footer { text-align: center; font-family: Calibri, "Segoe UI", sans-serif; font-size: .85rem; margin-top: .6rem; }
.ana-footer small { font-size: .75rem; color: #444; }
.anagrafica { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

.box input[type=text] { font: inherit; }

/* cells you can type in = light blue; plain text = can not be changed here */
.blank input[type=text], .blank input[type=number], .blank input[type=email],
.blank select, .blank textarea {
  background: #f1f6fc; border: 1px solid #cfdcec; border-radius: 4px;
}

/* AMFI logo as high as the Erasmus+ flag */
.amfi-logo { height: 74px; }
.blank-head, .ana-head { align-items: center; }

/* wider label column, less wrapping */
.blank td.label { width: 55%; }
.ana-table td.l { width: 58%; }


/* ===================== C. Printing ===================== */
@media print {
  html, body { background: #fff !important; }
  .no-print, .site-head, .flash { display: none !important; }
  .page, .page-desk { margin: 0; padding: 0; border: 0; max-width: none; }
  .blank input, .blank select, .blank textarea { color: #000; }
  .desk { display: block; }
  .desk.js .desk-sec { display: block; }
  .desk-sec { max-width: none; margin: 0; }
  .sheet { margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; break-after: page; overflow: visible; }
  .sheet-later { display: none; }
}

/* login and password pages: a small card in the middle */
@media screen { .page-narrow { max-width: 460px; margin-top: 3rem; } }

/* ===================== A2. AMFI list: teachers and their students (simple, like on paper) ===================== */
.plist { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 0 1.4rem; }
.plist-teacher { padding: 1rem 0; border-top: 1px solid var(--border); }
.plist-teacher:first-child { border-top: 0; }
.plist h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; margin: 0; font-size: 1.05rem; }
.plist h2 small { font-weight: 400; color: var(--muted); font-size: .9rem; }
.plist ol { margin: .4rem 0 .3rem; padding-left: 1.6rem; }
.plist li { padding: .3rem 0; border-bottom: 1px dotted var(--border); }
.plist-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; }
.plist-row .name { font-weight: 600; min-width: 11rem; }
.plist-row .company { color: var(--muted); min-width: 10rem; }
.plist .state { font-size: .85rem; color: var(--muted); }
.plist .state.new { color: var(--todo); font-weight: 600; }
.plist .state.done { color: var(--ok); }
.plist .acts { margin-left: auto; font-size: .85rem; white-space: nowrap; }
.plist .empty { margin: .4rem 0; color: var(--muted); font-size: .9rem; }
.plist-add { font-size: .9rem; font-weight: 600; }

/* the info page of a student (AMFI): plain, one column, easy to read */
.info-page { max-width: 560px; }
.info-form h2 { margin: 2rem 0 .2rem; padding-bottom: .3rem; font-size: 1.15rem; border-bottom: 2px solid var(--ink); }
.info-field { margin-top: .9rem; }
.info-field label { display: block; margin-bottom: .25rem; font-size: .95rem; font-weight: 600; color: var(--ink); }
.info-field input, .info-field select, .info-field textarea {
  width: 100%; padding: .5rem .6rem; font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid #8a96a3; border-radius: 4px; }
.info-field input:focus, .info-field select:focus, .info-field textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; }
.info-field textarea { min-height: 5rem; }
.info-field .errorlist { margin: .25rem 0 0; }
.info-actions { margin-top: 2rem; display: flex; gap: .6rem; }

.info-links { width: 100%; margin: .6rem 0 .4rem; border-collapse: collapse; }
.info-links th { width: 5.5rem; padding: .6rem .6rem .6rem 0; text-align: left; vertical-align: top; font-size: 1rem; }
.info-links td { padding: .45rem 0; }
.info-links input { width: 100%; padding: .45rem .6rem; font: inherit; font-size: .9rem; background: #f6f8fa; border: 1px solid #8a96a3; }
.info-links small { display: block; margin-top: .2rem; color: var(--muted); }
.info-resend { margin: .3rem 0 0 5.5rem; }

/* tutor: a row of the assessment without a mark */
.grid tr.row-error td { background: #fdecea; }
.grid tr.row-error .err { color: var(--danger); }

/* no rounded corners anywhere: straight blocks, fields and buttons */
*, *::before, *::after { border-radius: 0 !important; }

/* login page: demo accounts (only while DEBUG=True) */
.demo-logins p { margin-top: 0; }
.demo-acc { margin: 0 0 .7rem; }
.demo-acc strong { display: block; font-size: .9rem; margin-bottom: .15rem; }   /* the role on its own line */
.demo-acc span { display: flex; flex-wrap: wrap; gap: .35rem; }                 /* login + password under it */
.demo-logins code { white-space: nowrap; word-break: normal; }   /* email and password stay on one line */
.amfi-link.login-logo-link { display: flex; justify-content: center; }      /* the logo in the middle */

/* weekly log while filling in = exactly like the printout: same font and sizes,
   hours on 2 lines (morning / afternoon), white like paper, no boxes, no hints */
.blank.weektable textarea {
  display: block; width: 100%; margin: 0; padding: 0; font: inherit; color: inherit; line-height: inherit;
  background: transparent; border: 0; border-radius: 0; box-shadow: none; resize: none; overflow: hidden; }
.blank.weektable textarea.hours { text-align: center; }
.blank.weektable td.tasks textarea { min-height: 15rem; text-align: left; }
.blank.weektable textarea:focus { outline: 1px solid #b9c7d6; background: transparent; }
.sign-box { background: transparent; border: 0; border-radius: 0; padding: 0; }

/* the AMFI logo is a link to the official AMFI website */
.amfi-link { display: inline-flex; }

/* background of the whole site: the AMFI colours (dark blue, light blue, lilac, peach) as a soft, misty gradient.
   The white veil on top keeps it calm, so the white cards and blanks stay easy to read. Not printed. */
@media screen {
  body {
    min-height: 100vh;   /* the background fills the whole window, also on short pages */
    background-color: #e9edf5;
    background-image:
      linear-gradient(rgba(255, 255, 255, .55), rgba(255, 255, 255, .55)),
      radial-gradient(ellipse at 0% 0%, #1f4e79 0%, transparent 55%),
      radial-gradient(ellipse at 100% 0%, #f4a261 0%, transparent 50%),
      radial-gradient(ellipse at 85% 100%, #c8b6ef 0%, transparent 60%),
      radial-gradient(ellipse at 10% 100%, #8fb6e6 0%, transparent 60%),
      linear-gradient(135deg, #a9bfe8 0%, #d8c9f1 60%, #f3d1b8 100%);
    background-attachment: fixed;
  }
}

/* AMFI list: small search above the teachers and students */
.search { display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; }
.search input { width: 260px; padding: .4rem .6rem; font: inherit; font-size: .9rem; border: 1px solid #8a96a3; border-radius: 4px; }
.search button { padding: .4rem .9rem; font-size: .9rem; }
.search a { font-size: .9rem; }
[hidden] { display: none !important; }   /* hidden by the live search */

/* ===================== D. Printout = real A4 sheets =====================
   print.js adds the class "a4" to .print-all: then every blank is ONE A4 sheet (210 x 297 mm),
   and a sheet's text is made a little smaller (zoom on .fit) if it is too long,
   so a blank never runs onto a second sheet: 1 blank = 1 sheet, no empty pages.
   On the SCREEN the same A4 sheets are shown enlarged to the full width of the page
   (--sheet-zoom), so the screen is wide AND looks exactly like the paper. */
.print-page { margin-bottom: 2rem; background: #fff; border: 1px solid #d5dde5; border-radius: 6px; padding: 1rem 1.4rem; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.print-page .blank-head { margin-top: 0; }
@page printout { size: A4; margin: 0; }          /* no browser header/footer, no extra margins */
.print-all { page: printout; }
.print-all.a4 .print-page {
  position: relative; width: 210mm; height: 296mm;   /* 296 (not 297): rounding never pushes a sheet onto 2 pages */
  margin: 0 auto 1.5rem; padding: 12mm 14mm; overflow: hidden;
  background: #fff; color: #111; border: 1px solid #d5dde5; box-shadow: 0 1px 6px rgba(0,0,0,.12);
  font-size: 10pt; line-height: 1.35; break-after: page; page-break-after: always; }
.print-all.a4 .print-page:last-of-type { break-after: auto; page-break-after: auto; }
.print-all.a4 .fit { min-height: 100%; display: flex; flex-direction: column; }   /* print.js sets its zoom */

/* header, titles and tables on a sheet */
.print-all.a4 .blank-head { margin: 0 0 4mm; }
.print-all.a4 .eu-flag { width: 66px; height: 44px; }
.print-all.a4 .erasmus { font-size: 20pt; margin-left: 0; }
.print-all.a4 .amfi-logo { height: 52px; }
.print-all.a4 .blank-title { font-size: 15pt; margin: 0 0 5mm; }
.print-all.a4 table.blank { margin-bottom: 5mm; }
.print-all.a4 .blank td.label, .print-all.a4 .blank td.txt, .print-all.a4 .blank td.center,
.print-all.a4 .blank th.hd { padding: 1.8mm 2.4mm; font-size: 9.5pt; }
.print-all.a4 .blank ol { font-size: 9pt; margin: 1.5mm 0; padding-left: 6mm; }
.print-all.a4 .blank ol li { margin-bottom: 1.2mm; }
.print-all.a4 .blank td.tasks { height: auto !important; min-height: 20mm; font-size: 9.5pt; }
.print-all.a4 .grid td.cell { padding: 2.2mm 0; }
.print-all.a4 .blank tr { break-inside: avoid; }

/* Anagrafica sheet */
.print-all.a4 .anagrafica { font-size: 10pt; }
.print-all.a4 .ana-erasmus { font-size: 22pt; }
.print-all.a4 .ana-title { font-size: 17pt; margin: 4mm 0 4mm; }
.print-all.a4 .ana-table td { padding: 2mm 2.4mm; font-size: 9.5pt; }
.print-all.a4 .ana-table td.l { font-size: 9.5pt; }
.print-all.a4 .ana-sub { font-size: 9.5pt; margin: 5mm 0 2mm; }
.print-all.a4 .ana-schedule th, .print-all.a4 .ana-schedule td { font-size: 8.5pt; }
.print-all.a4 .ana-schedule td { height: 13mm; }
.print-all.a4 .ana-footer { margin-top: auto; padding-top: 4mm; font-size: 9pt; }   /* footer at the bottom of the sheet */
.print-all.a4 .anagrafica { flex: 1; display: flex; flex-direction: column; }

/* weekly log: 2 weeks per sheet */
.print-all.a4 .slim-head { font-size: 12pt; margin-bottom: 5mm; }
.print-all.a4 .slim-head span { font-size: 9.5pt; }
.print-all.a4 .weeks-page .weektable { font-size: 10pt; margin-bottom: 6mm; break-inside: avoid; }
.print-all.a4 .weeks-page .weektable th.hd { font-size: 9pt; padding: 1.6mm 1.6mm; }
.print-all.a4 .weeks-page .weektable td { height: 13.5mm; }
.print-all.a4 .weeks-page .weektable td.tasks { font-size: 9.5pt; }

/* assessment: date and signature at the bottom part of the sheet */
.print-all.a4 .sign-row { margin-top: 12mm; font-size: 10pt; }

/* Certificate: a real certificate that fills the whole sheet */
.print-all.a4 .cert-page .certificate { flex: 1; display: flex; flex-direction: column; font-size: 12pt; line-height: 1.5; }
.print-all.a4 .cert-page .blank-title { font-size: 24pt; margin: 10mm 0 2mm; }
.print-all.a4 .cert-page .blank-title small { display: block; font-size: 15pt; margin-top: 2mm; }
.print-all.a4 .cert-page .certificate hr { margin: 6mm 0 14mm; }
.print-all.a4 .cert-page .certificate p { margin: 0 0 6mm; }
.print-all.a4 .cert-page .certificate .big { font-size: 20pt; margin: 2mm 0 10mm; }
.print-all.a4 .cert-page .cert-sign { margin-top: auto; padding-bottom: 12mm; font-size: 11pt; }
.print-all.a4 .cert-page .cert-sign p { margin: 0 0 6mm; }

@media screen {
  .print-all.a4 .print-page { zoom: var(--sheet-zoom, 1); }
  .print-all.a4.measuring .print-page { zoom: 1; }   /* print.js measures the sheets at their real A4 size */
}
@media print {
  .print-page { margin: 0; border: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .print-page:last-of-type { break-after: auto; page-break-after: auto; }
  .draft-stamp { display: block; position: fixed; top: 5mm; right: 14mm; z-index: 5; border: 1.5px solid #b00020; color: #b00020;
    background: #fff; padding: 1px 8px; font-size: 9pt; font-weight: 700; }
}

/* weekly log: easier to fill in (screen only - the printout stays like the paper blank) */
.weektable .wd { color: var(--muted); font-size: .78em; margin-right: .15em; }
.day-h { display: block; font-family: "Segoe UI", system-ui, sans-serif; font-size: .74rem; color: var(--muted); line-height: 1.2; }
.day-h:empty { display: none; }
.day-h.bad { color: #b42318; font-weight: 600; }
.work-total { margin: -.3rem 0 .9rem; font-family: "Segoe UI", system-ui, sans-serif; font-size: .9rem; }
.week-sum b { color: var(--dark); }
button.unsaved { box-shadow: 0 0 0 3px rgba(240, 180, 41, .55); }
.copy-hours[disabled] { opacity: .5; cursor: default; }
@media screen {
  .weektable tr.weekend td:not([rowspan]) { background: #f6f8fa; }
  .weektable tr.weekend .wd { font-weight: 600; }
  /* the hours you can write: a light dotted line under them, so you see where to click */
  .blank.weektable textarea.hours { border-bottom: 1px dashed #c4ced9; min-height: 1.5em; }
  .blank.weektable textarea.hours::placeholder, .blank.weektable td.tasks textarea::placeholder { color: #a9b4c0; font-size: .85em; }
}
/* arrival / departure day in the weekly log (also printed: it explains the date) */
.weektable .trip { display: block; font-size: .72em; font-style: italic; color: var(--muted); }

/* every weekly table has the SAME columns (else the browser makes each week a bit different) */
table.blank.weektable { table-layout: fixed; }
.weektable th:nth-child(1) { width: 10%; }   /* Week */
.weektable th:nth-child(2) { width: 15%; }   /* Date */
.weektable th:nth-child(3) { width: 16%; }   /* Working schedule */
.weektable th:nth-child(4) { width: 16%; }   /* Tutor's signature */
                                              /* Tasks: the rest */
.weektable td { overflow-wrap: anywhere; }

/* on paper: no frame, no shadow, no gap around the A4 sheets (the screen view keeps them) */
@media print {
  .print-all.a4 .print-page { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
}

/* the weekday always on its own small line above the date: every date cell looks the same */
.weektable .wd { display: block; margin: 0; line-height: 1.1; }
/* Journal: the "Tasks and activities" box keeps its room on paper even when it is empty */
.print-all.a4 .blank td.tasks { height: 18mm !important; }
.print-all.a4 .weeks-page .weektable td.tasks { height: auto !important; }
