:root {
    --main-col: #D6001C;
    --bg-col: #960014;
    --compl-main-col: #65D60B;
    --compl-bg-col: #458A0E;
    --header-text-col: #0b0b0b;
    --text-col: #ffffff;
    --text-hover-col: #131168;
    --warn-col: #eb9e00;
    --header-height: 60px;
    --footer-height: 20px;
}

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    box-sizing: border-box;
    color: var(--text-col);
}

textarea {
    box-sizing: border-box;
}


/* HTML5 display-role reset for older browsers */

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
    display: block;
}

body {
    line-height: 1;
}

ol,
ul {
    list-style: none;
}

blockquote,
q {
    quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
    content: '';
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}


/* end css reset */

html {
    /* background: url("./resources/portrait.jpg"); */
    background-position: right top;
    background-size: cover;
    background-repeat: no-repeat;
    background-color: var(--bg-col);
    font-family: Verdana, sans-serif;
    font-size: 13px;
}

body {
    margin: 0;
    border: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

:focus-visible {
    outline: 3px solid var(--warn-col);
    outline-offset: 2px;
}

label {
    font-size: 16px;
    font-weight: normal;
    padding-top: 5px;
}

h2 {
    font-size: 120%;
    text-align: left;
    padding: 5px;
}

button {
    color: var(--text-col);
}

@font-face {
    font-family: "dseg";
    src: url("resources/DSEG14Modern-Italic.ttf");
}

.tip {
    padding: 5px 10px;
    font-size: 60%;
}

.button--confirm {
    margin: 0;
    font-size: 16pt;
    font-weight: bold;
    background: var(--compl-bg-col);
    margin-top: 30px;
    border: 0;
    padding: 10px 16px;
    border-radius: 4px;
    color: var(--text-col);
    cursor: pointer;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .25);
    transition: filter .15s, transform .05s;
}

.button--confirm:hover {
    filter: brightness(1.12);
}

.button--confirm:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}

.button--confirm:disabled {
    opacity: .6;
    cursor: progress;
}

.button--link {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 10px;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
}

span.button--link {
    font-weight: bold;
}

a.button--link:link,
a.button--link:visited,
a.button--link:active {
    color: var(--text-col);
}

a.button--link:hover {
    text-decoration: underline;
}

.button--logout {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--text-col);
    text-decoration: underline;
    cursor: pointer;
}

.centered {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.panel {
    padding: 20px;
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.panel--login label,
.panel--reg label {
    text-align: left;
    margin-top: 12px;
    font-size: 15px;
}

.panel--login input:not(.button),
.panel--reg input:not(.button) {
    font-size: 16px;
    padding: 10px 12px;
    margin: 6px 0 0;
    border: 2px solid transparent;
    border-radius: 4px;
    color: #111;
    background: #fff;
}

.panel--login input:not(.button):focus,
.panel--reg input:not(.button):focus,
.textarea:focus {
    outline: none;
    border-color: var(--warn-col);
}

.panel input[aria-invalid="true"] {
    border-color: var(--warn-col);
    background: #fff4dc;
}

.field-error {
    display: block;
    text-align: left;
    font-size: 13px;
    color: #ffd27a;
    margin-top: 4px;
}

.field-error:empty {
    display: none;
}

.panel .flash {
    text-align: left;
    line-height: 1.35;
    margin-bottom: .5rem;
}

.form-switch {
    margin-top: 1rem;
    font-size: 14px;
}

.form-switch a {
    color: var(--text-col);
    font-weight: bold;
}

.welcome {
    font-size: 20pt;
}

.sans {
    font-family: Verdana, sans-serif;
}

.target_name {
    font-size: 200%;
    font-weight: bold;
}

.reveal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    margin: .75rem 0;
    padding: 14px;
    background: rgba(0, 0, 0, .2);
    border-radius: 8px;
}

.target-note {
    line-height: 1.4;
}

.target-address {
    font-size: 90%;
    display: block;
    width: 100%;
    margin-top: .5rem;
    padding: 8px 10px;
    border: 1px dashed rgba(255, 255, 255, .55);
    border-radius: 6px;
    background: none;
    font-family: inherit;
    line-height: 1.4;
    color: var(--text-col);
    cursor: pointer;
}

.target-address:hover {
    background: rgba(255, 255, 255, .1);
}

.copy-hint {
    display: block;
    font-size: 11px;
    opacity: .8;
    margin-top: 4px;
}

.timer-date {
    margin-top: 6px;
    font-size: 12px;
    opacity: .85;
    margin-bottom: .5rem;
}

.dash-section {
    margin-top: 1.25rem;
    text-align: left;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
}

.save-status {
    font-size: 12px;
    opacity: .9;
    white-space: nowrap;
}

.save-status.is-error {
    color: #ffd27a;
    font-weight: bold;
}

.dash-section .tip,
.user-list .tip {
    font-size: 12px;
    padding: 0 5px 5px;
    opacity: .85;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px);
    max-width: calc(100% - 32px);
    padding: 10px 16px;
    border-radius: 6px;
    background: rgba(20, 20, 20, .9);
    color: #fff;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 1000;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.header {
    background: var(--main-col);
    display: flex;
    padding: 10px;
    height: var(--header-height);
    font-size: 16pt;
    font-family: Verdana, sans-serif;
}

.header .logo {
    height: 100%;
    background: url("resources/logo_small_white.png");
    background-size: contain;
    background-repeat: no-repeat;
    flex: 1;
}

.footer {
    margin-top: auto;
    padding: 12px 20px;
    font-size: 11px;
    opacity: .8;
}

.reg_table {
    font-family: Verdana, sans-serif;
    text-align: right;
}

.dash-pane {}

.separator {
    margin-top: .5rem;
    margin-bottom: .5rem;
}

.line {
    margin-bottom: 1rem;
}

.textarea {
    width: 100%;
    min-height: 70px;
    resize: vertical;
    padding: 8px 10px;
    margin-top: 4px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.35;
    color: #111;
    border: 2px solid transparent;
    border-radius: 4px;
}

.user-list {
    margin-top: 1rem;
    text-align: left;
    background-color: var(--warn-col);
    border: 1px solid black;
    border-radius: 5px;
}

.user-list,
.user-list * {
    color: #1b1b1b;
}

.user-list__item {
    display: block;
    text-align: left;
    padding: 6px 10px;
}

label.user-list__item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border-radius: 4px;
    margin: 0 4px;
}

label.user-list__item:hover {
    background: rgba(255, 255, 255, .25);
}

/* regole separate: un :has() non supportato invaliderebbe tutta la regola */
label.user-list__item.is-checked {
    background: rgba(255, 255, 255, .45);
    font-weight: bold;
}

label.user-list__item:has(input:checked) {
    background: rgba(255, 255, 255, .45);
    font-weight: bold;
}

label.user-list__item:has(input:disabled) {
    cursor: default;
    opacity: .75;
}

.user-list input[type="radio"] {
    accent-color: var(--compl-bg-col);
    width: 16px;
    height: 16px;
    margin: 0;
}

.timer {
    font-family: dseg;
    font-size: 2rem;
    position: relative;
    height: 2rem;
    padding: .5rem;
    background: #9aad48;
    border: 3px solid #000;
    border-radius: 3px;
    box-sizing: content-box;
    width: min-content;
    align-self: center;
}

.timer .foreground {
    position: absolute;
    z-index: 100;
    left: 0;
    color: #0a0b04;
    right: 0;
}

.timer .background {
    position: absolute;
    z-index: 50;
    color: #0a0b041a;
    left: 0;
    right: 0;
}

.register-deadline {
    background-color: var(--warn-col);
    color: #1b1b1b;
    padding: 8px;
    display: block;
    text-align: center;
    line-height: 1.35;
}

.register-deadline * {
    color: inherit;
}

.register-deadline b {
    font-weight: bold;
}

@media (min-width: 600px) {
    .panel {
        margin-top: 24px;
        margin-bottom: 24px;
        padding: 24px 28px;
        background: rgba(90, 0, 12, .85);
        backdrop-filter: blur(3px);
        border-radius: 8px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
    }
    html {
        background: url("./resources/christmas_bg.jpg") right top / cover fixed;
        background-color: var(--bg-col);
    }
}
/* --- Amministrazione --- */

.panel--admin {
    max-width: 1100px !important;
    margin: 20px auto 40px;
    background: rgba(0, 0, 0, .35);
    border-radius: 5px;
    line-height: 1.4;
}

.panel--admin h1 {
    font-size: 20pt;
    margin-bottom: 1rem;
}

.panel--admin h2 {
    font-size: 15pt;
    padding: 0 0 .5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .3);
    margin-bottom: .75rem;
}

.panel--admin h3 {
    font-size: 12pt;
    font-weight: bold;
    margin: 1.25rem 0 .5rem;
}

.panel--admin a {
    color: var(--text-col);
}

.panel--admin input,
.panel--admin select {
    color: #000;
    font: inherit;
    padding: 3px 5px;
}

.panel--admin small {
    font-size: 85%;
    opacity: .8;
}

.admin-nav {
    margin-bottom: 1rem;
}

.admin-section {
    margin-bottom: 2rem;
}

.admin-table {
    width: 100%;
    text-align: left;
}

.admin-table th,
.admin-table td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .2);
    vertical-align: middle;
}

.admin-table th {
    font-weight: bold;
    white-space: nowrap;
}

.admin-table tr.is-selected td {
    background: rgba(255, 255, 255, .12);
}

.table-wrap {
    overflow-x: auto;
}

.admin-form {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: flex-end;
    margin: .5rem 0 1rem;
}

.admin-form label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11pt;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
}

.admin-actions form {
    display: flex;
    gap: .5rem;
    align-items: center;
}

label.inline {
    font-size: 11pt;
    padding: 0;
}

.inline-form {
    display: inline;
}

.admin-button {
    background: var(--compl-bg-col);
    border: 0;
    border-radius: 3px;
    padding: 6px 12px;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
}

.admin-button--danger {
    background: #4a0009;
}

.admin-button--small {
    padding: 3px 8px;
    font-weight: normal;
}

.admin-status {
    margin-bottom: .75rem;
}

.flash {
    padding: 8px 12px;
    border-radius: 3px;
    margin-bottom: .75rem;
}

.flash--ok {
    background: var(--compl-bg-col);
}

.flash--error {
    background: var(--warn-col);
    color: #000;
}

.warn {
    color: var(--warn-col);
    font-weight: bold;
}

.join-list ul {
    padding-bottom: 5px;
}

.withdraw {
    margin-top: 2rem;
    font-size: 90%;
}

fieldset.user-list {
    min-width: 0;
    padding-bottom: 6px;
}

.user-list .section-head {
    padding-right: 8px;
}

.user-list .save-status.is-error {
    color: #6b0000;
}
