/* Insegnanti (teachers): photo cropper, lesson blocks per student, temporary password buttons, codice fiscale field.
   Used by the teacher portal and by the staff teacher list. */

.photo-row { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.cropper { position: relative; width: min(280px, 100%); aspect-ratio: 1; margin: .4rem auto; background: #ddd; border: 1px solid var(--line); cursor: grab; touch-action: none; }
.cropper canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.cropper:active { cursor: grabbing; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle closest-side, transparent 97%, rgba(20, 35, 29, .6) 100%); }

/* one collapsible block per student */
details.student { padding: 0; }
details.student > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; }
details.student > summary::-webkit-details-marker { display: none; }
details.student > summary::before { content: "\25B8"; color: var(--brass); margin-right: .7rem; font-size: .9rem; transition: transform .15s; flex: none; }
details.student[open] > summary::before { transform: rotate(90deg); }
details.student > summary .st-name { flex: 1; min-width: 0; }
details.student > summary .st-prog { min-width: 7.5rem; text-align: right; }
details.student > summary .st-prog .prog { margin-left: auto; width: 100%; }
details.student[open] > summary { border-bottom: 1px solid var(--line); }
details.student > :not(summary) { margin-left: 1.25rem; margin-right: 1.25rem; }
details.student > :last-child { margin-bottom: 1.1rem; }
details.student > summary + * { margin-top: 1rem; }
.add-lesson { display: flex; gap: .8rem 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.add-lesson .f { min-width: 12rem; }
@media (max-width: 720px) { details.student > summary { padding: .9rem 1rem; } details.student > summary .st-prog { min-width: 5.5rem; } .add-lesson .f { flex: 1; } }

/* status + temporary password of a teacher waiting for the first login, all on one line */
.st-line { display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.temp-pw { display: inline-flex; align-items: center; gap: .25rem; }
.temp-pw .pw-val { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; letter-spacing: 0; background: var(--paper, #fbf8ef); border: 1px dashed var(--brass, #c8a041); padding: .1rem 0; user-select: all;
  /* same width hidden or shown (one cell per character), so the row doesn't jump when the password is revealed */
  display: inline-block; box-sizing: content-box; width: calc(var(--n, 10) * 1ch + .9rem); text-align: center; overflow: hidden; white-space: nowrap; }
.temp-pw .ico { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; padding: 0; background: transparent; border: 1px solid var(--line, #d8d2bf); color: var(--charcoal, #1f2a24); cursor: pointer; }
.temp-pw .ico svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.temp-pw .ico:hover, .temp-pw .ico.on { background: var(--brass, #c8a041); border-color: var(--brass, #c8a041); }
.temp-pw .ico.done { background: var(--ok, #2f6b3f); border-color: var(--ok, #2f6b3f); color: #fff; }
.temp-pw .ico.fail { background: var(--ox, #8a2f23); border-color: var(--ox, #8a2f23); color: #fff; }
@media (max-width: 640px) { .st-line { flex-wrap: wrap; white-space: normal; } }

/* codice fiscale field with its "Calcola" button */
.cf-row { display: flex; gap: .4rem; align-items: stretch; }
.cf-row input { flex: 1; min-width: 0; text-transform: uppercase; }
.cf-row .btn { white-space: nowrap; }
[data-cf-msg].bad { color: var(--ox, #8a2f23); }
[data-cf-msg].good { color: var(--ok, #2f6b3f); }

/* signed ricevuta / autocertificazione uploaded back by the teacher: one block per document, name + status, the file, one muted line */
.signed-docs > h2 { margin-bottom: .2rem; }
.signed-doc { padding: .9rem 0; border-top: 1px solid var(--line); }
.signed-doc:first-of-type { border-top: 0; padding-top: .4rem; }
.signed-doc:last-child { padding-bottom: 0; }
.signed-doc-head { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .6rem; font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.signed-doc-file { display: block; margin: .3rem 0 .15rem; font-weight: 500; overflow-wrap: anywhere; }
.signed-doc-meta { display: flex; flex-wrap: wrap; gap: .1rem 0; margin: .1rem 0 0; font-size: .8rem; color: #6b6f5e; }
.signed-doc-meta > * + *::before { content: "·"; margin: 0 .5rem; color: #9a9d8c; text-decoration: none; display: inline-block; }
.signed-doc-meta a { text-decoration: underline; }
.signed-doc .flash { margin: .6rem 0 0; }
details.signed-doc-old { margin-top: .5rem; }
details.signed-doc-old > summary { cursor: pointer; font-size: .8rem; color: #6b6f5e; }
details.signed-doc-old ul.plain { margin: .3rem 0 0; }
details.signed-doc-old li { display: flex; flex-wrap: wrap; gap: .1rem .7rem; align-items: baseline; }
.signed-steps { list-style: none; margin: .7rem 0 0; padding: 0; display: grid; gap: .9rem; }
.signed-steps li { display: grid; grid-template-columns: 1.7rem 1fr; gap: .7rem; align-items: start; }
.signed-steps .n { display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--ink); color: var(--paper, #f7f4e8); font-size: .85rem; font-weight: 600; }
.signed-steps li > div { padding-top: .2rem; min-width: 0; }
.signed-step-action { margin-top: .5rem; }
.signed-upload { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .8rem; margin-top: .5rem; }
.signed-upload .btn { flex: 0 0 auto; }
.signed-upload input[type=file] { flex: 1 1 14rem; min-width: 0; max-width: 100%; }
.signed-upload-hint { margin: .3rem 0 0; }
details.signed-doc-old .signed-upload { margin-top: .5rem; }
@media (max-width: 480px) { .signed-upload .btn { width: 100%; } }
.fiscal-kv dd { overflow-wrap: anywhere; }
.fiscal-kv .missing { color: #9a9d8c; font-style: italic; font-weight: 400; }
.fiscal-kv .linkbtn { margin-left: .5rem; }
.profile-save { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.profile-save .badge { margin: 0; }
.signed-docs .signed-doc.sep { border-top: 1px solid var(--line); margin-top: 1.1rem; padding-top: 1rem; }


/* Registro (portale insegnanti): one collapsible card per lesson, the three notes inside */
.filters-lite { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: flex-end; padding: .9rem 1.25rem; }
.filters-lite .f { min-width: 14rem; }
details.reg { padding: 0; }
details.reg > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.25rem; }
details.reg > summary::-webkit-details-marker { display: none; }
details.reg > summary::before { content: "\25B8"; color: var(--brass); margin-right: .7rem; font-size: .9rem; transition: transform .15s; flex: none; }
details.reg[open] > summary::before { transform: rotate(90deg); }
details.reg > summary .st-name { flex: 1; min-width: 0; }
details.reg[open] > summary { border-bottom: 1px solid var(--line); }
.reg-badges { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; flex: none; }
.reg-form { display: grid; gap: .9rem; padding: 1rem 1.25rem 1.1rem; }
.reg-form textarea { width: 100%; min-height: 5.5rem; resize: vertical; }
.reg-form .actions { align-items: center; }
details.reg > .reg-h, details.reg > .reg-text, details.reg > .hint { margin-left: 1.25rem; margin-right: 1.25rem; }
.reg-h { margin: 1rem 0 .1rem; font-size: 1rem; }
.reg-text { margin: 0 0 .6rem; }
@media (max-width: 720px) { details.reg > summary { padding: .8rem 1rem; } .reg-form { padding: .9rem 1rem 1rem; } .filters-lite .f { flex: 1; min-width: 10rem; } }
