/* style.css - reth1nk 2026 */

@font-face {
    font-family: 'Funnel Display';
    src: url('../fonts/Funnel_Display/FunnelDisplay-VariableFont_wght.ttf') format('truetype');
    font-weight: 300 800;
    font-display: swap;
}

:root {
    --main-color: #082064;
    --accent-green: #4DB848;
    --accent-cyan: #0DC3ED;
    --text-color: #111111;
    --text-muted: #4a5568;
    --bg-page: #f5f7fa;
    --input-border: #c8d1da;
    --font-display: 'Funnel Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    margin: 20px;
    padding: 20px;
    margin-top: 0;
    padding-top: 0;
    background:
        linear-gradient(160deg, rgba(11, 61, 107, 0.18) 0%, rgba(11, 61, 107, 0.06) 40%, transparent 65%),
        linear-gradient(200deg, transparent 30%, rgba(13, 195, 237, 0.18) 60%, rgba(13, 195, 237, 0.22) 100%),
        linear-gradient(340deg, rgba(77, 184, 72, 0.12) 0%, transparent 40%),
        var(--bg-page);
    background-attachment: fixed;
    min-height: 100vh;
    margin-bottom: 0;
    padding-bottom: 0;
}

section {
    max-width: 1200px;
    margin: 0 auto;
}

.section-instructions {
    font-weight: 300;
    font-style: italic;
}

.boxed {
    width: 70%;
    margin: 0 auto;
}

.intro {
    color: var(--main-color);
    margin: 0 auto;
    width: calc(100% - 60px);
}

.intro .boxed.colored {
    background: #e4f1fa;
    color: #0a0a0a;
    padding: 28px 30px;
    font-size: 17px;
    margin-bottom: 12px;
    line-height: 1.6;
}

/* Sticky Header */
.sticky-header {
    position: fixed;
    top: -70px;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--main-color);
    z-index: 1000;
    transition: top 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.sticky-header.visible {
    top: 0;
}

.sticky-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    height: 100%;
}

.sticky-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sticky-left a {
    display: flex;
    align-items: center;
}

.sticky-logo {
    height: 36px;
    width: auto;
}

.sticky-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-display);
    font-size: 13px;
    margin: 0;
    font-weight: 300;
    line-height: 1.2;
}

.sticky-subtitle strong {
    font-weight: 700;
}

.sticky-right {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 13px;
    line-height: 1.3;
}

.sticky-date {
    font-weight: 300;
}

.sticky-venue {
    background: var(--accent-green);
    padding: 4px 15px;
    font-weight: 300;
    margin-right: -30px;
    line-height: 1.4;
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
}

/* Header */
header {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    width: calc(100% + 80px);
    margin-left: -40px;
    background: url('../img/bg.png') center center / cover no-repeat;
    position: relative;
    overflow: hidden;
    min-height: 220px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    padding: 30px 60px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-left a {
    display: block;
}

.header-logo {
    height: 120px;
    width: auto;
}

.header-subtitle {
    font-family: var(--font-display);
    font-weight: 300;
    color: #fff;
    font-size: 22px;
    line-height: 1.3;
    margin: 0;
}

.header-subtitle strong {
    font-weight: 700;
}

.header-right {
    text-align: right;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
}

.header-date {
    font-family: var(--font-display);
    font-size: 28px;
    line-height: 1.15;
    margin: 0;
    color: #fff;
}

.header-date span {
    font-size: 36px;
}

.header-date strong {
    font-weight: 700;
}

.header-venue {
    background: var(--accent-green);
    padding: 10px 20px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 16px;
    line-height: 1.4;
}

.header-venue strong {
    font-weight: 700;
}

.header-venue p {
    margin: 0;
    color: #fff;
}

/* Form */
h1 {
    text-align: center;
    font-family: var(--font-display);
}

h2 {
    font-size: 1.25em;
    font-family: var(--font-display);
}

.form-info {
    font-weight: normal;
    margin-bottom: 20px;
}

form {
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 40px;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.form-line {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.counter {
    color: var(--text-muted);
    font-weight: 600;
    text-align: right;
    font-size: 0.85em;
    margin-bottom: -16.5px;
}

.counter.exceeded {
    color: #c0392b;
}

label {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--main-color);
    font-size: 18px;
    margin-bottom: 4px;
}

.form-el {
    width: 70%;
    margin-bottom: 24px;
}

/* --- Input --- */
textarea,
input[type="email"],
select,
input[type="file"],
input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    margin: 5px 0;
    border: 1px solid var(--input-border);
    border-radius: 0;
    font-size: 1em;
    background-color: #fff;
    color: var(--text-color);
    font-family: inherit;
    transition: border-color 0.2s;
    box-shadow: none;
}

textarea,
input[type="file"] {
    height: 100px;
    resize: none;
}

textarea:focus,
input:focus,
select:focus {
    outline: none;
    border-color: var(--main-color);
}

/* --- Bottoni --- */
button {
    margin-top: 20px;
    padding: 13px 36px;
    font-size: 16px;
    font-weight: 700;
    margin-left: auto;
    border: none;
    border-radius: 0;
    background-color: var(--main-color);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: none;
}

button:hover {
    background-color: #061850;
    color: #fff;
}

/* --- Custom Select --- */
.custom-select {
    position: relative;
    display: block;
    width: 100%;
    border: 1px solid var(--input-border);
    border-radius: 0;
    background-color: #fff;
    cursor: pointer;
    padding: 12px 14px;
    margin-top: 5px;
    transition: border-color 0.2s;
    box-shadow: none;
}

.custom-select:hover {
    border-color: var(--main-color);
}

.custom-select select {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 2;
    cursor: pointer;
    pointer-events: none;
}

.selected-option {
    display: block;
    color: var(--main-color);
    padding-right: 30px;
}

.custom-select::before {
    content: "\25BC";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--main-color);
    font-size: 0.7em;
}

.custom-options {
    position: absolute;
    top: 100%;
    left: -1px;
    right: -1px;
    background: #fff;
    border: 1px solid var(--main-color);
    border-top: none;
    z-index: 999;
    display: none;
    max-height: 390px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.custom-option {
    padding: 13px 14px;
    cursor: pointer;
    color: var(--main-color);
    font-size: 15px;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background-color: var(--main-color);
    color: #fff;
}

form h3 {
    font-family: var(--font-display);
    color: var(--main-color);
    font-size: 28px;
    margin-bottom: 0;
    width: 70%;
    margin-left: 0;
}

form p {
    color: var(--main-color);
    font-size: 16px;
    font-weight: bold;
    width: 70%;
}

/* --- File Upload --- */
.custom-file-button {
    display: inline-block;
    padding: 10px 28px;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    background-color: var(--main-color);
    color: #fff;
    margin-top: 8px;
    transition: background-color 0.2s;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-file-button:hover {
    background-color: #061850;
    color: #fff;
}

.file-list {
    margin-top: 1em;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.file-preview {
    position: relative;
    width: 100px;
    text-align: center;
    cursor: pointer;
}

.file-preview:hover .remove-file {
    display: block;
}

.file-preview:hover img {
    opacity: 0.5;
    filter: grayscale(100%);
}

.file-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 1px solid var(--input-border);
}

.file-preview .file-name {
    font-size: 0.75em;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 15px;
    color: var(--text-muted);
}

.remove-file {
    display: none;
    text-align: center;
    font-size: 10px;
    color: #c0392b;
    font-weight: 600;
    margin: 0;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.mobile-remove-advice {
    display: none;
    font-size: 12px;
    color: var(--text-muted);
    margin: 10px 0;
    font-weight: normal;
}

/* Upload progress */
.upload-bar-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: relative;
}

.upload-progress {
    display: none;
    width: 100%;
    height: 4px;
    background: #e0e4e8;
    margin-top: 10px;
}

.upload-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-green);
    transition: width 0.3s ease;
}

.upload-percent {
    display: none;
    position: absolute;
    top: -20px;
    right: 0;
    font-size: 0.8em;
    color: var(--main-color);
    font-weight: bold;
}

#submitBtn {
    float: right;
    font-size: 18px;
    padding: 15px 48px;
    background-color: var(--accent-green);
}

#submitBtn:hover {
    background-color: #3a9636;
}

/* --- WYSIWYG Editor --- */
.wysiwyg-wrapper {
    margin-bottom: 20px;
}

.wysiwyg-editor {
    border: 1px solid var(--input-border);
    border-radius: 0;
    background-color: #fff;
    margin-top: 5px;
    margin-bottom: 5px;
    overflow: hidden;
    box-shadow: none;
    transition: border-color 0.2s;
}

.wysiwyg-editor:focus-within {
    border-color: var(--main-color);
}

.editor-toolbar {
    background: #f5f7f9;
    border-bottom: 1px solid #e0e4e8;
    padding: 6px 10px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 2px;
}

.editor-toolbar button {
    background-color: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    width: 30px;
    height: 30px;
    transition: background-color 0.15s;
    margin: 0;
    color: #6b7c8d;
    padding: 0;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: none;
    letter-spacing: 0;
}

.editor-toolbar button:hover {
    color: var(--main-color);
    background-color: #e4e8ec;
    transform: none;
}

.editor-content {
    min-height: 150px;
    padding: 12px 14px;
    outline: none;
    overflow-y: auto;
    line-height: 1.6;
}

sup,
sub {
    font-size: 0.7em;
}

/* Alerts */
.alert {
    padding: 24px 30px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    text-wrap: balance;
    margin: 20px auto;
    font-family: var(--font-display);
}

.alert-success {
    background: #27ae60;
    color: #fff;
}

.alert-error {
    background: #c0392b;
    color: #fff;
}

/* Form inline errors */
form .error-message {
    font-size: 14px;
    text-align: left;
    padding: 8px 0;
    font-weight: 600;
    color: #c0392b;
}

/* Deadline table */
.deadline {
    margin-top: 40px;
}

table {
    border-collapse: collapse;
}

table,
th,
td {
    border: 1px solid #c8d1da;
}

th {
    background-color: var(--main-color);
    color: #fff;
    padding: 11px 16px;
    font-weight: 600;
    text-align: left;
}

td {
    padding: 11px 16px;
    background: #fff;
}

/* Footer */
footer {
    width: calc(100% + 80px);
    margin-left: -40px;
    margin-top: 40px;
    text-align: center;
}

.footer-img {
    width: 100%;
    max-width: 1400px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.footer-links {
    background-color: var(--main-color);
    color: #fff;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 18px;
    font-size: 0.9em;
}

footer a {
    color: #fff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

form a {
    color: var(--main-color);
    text-decoration: none;
}

form a:hover {
    text-decoration: underline;
}

/* Checkbox */
label.checkbox-label {
    font-size: 14px;
}

#termini_condizioni {
    display: inline-block;
    box-shadow: none;
    font-weight: normal;
    border: none;
    width: auto;
    margin-right: 8px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
}

form .checkbox-label a {
    text-decoration: underline;
}

.inline {
    display: inline-block;
}

form label em {
    font-weight: 400;
    font-size: 0.7em;
    display: block;
    color: var(--text-muted);
    margin-top: 2px;
}

/* PDF icon in previews */
.pdf-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border: 1px solid var(--input-border);
    background: #fafafa;
}

.pdf-icon span {
    font-size: 12px;
    font-weight: bold;
    color: #c0392b;
}

/* --- Background squares parallax --- */
.bg-squares {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.sq {
    position: absolute;
    display: block;
    will-change: transform;
}

/* Lato sinistro */
.sq-1 {
    width: 120px;
    height: 120px;
    background: var(--accent-green);
    top: 3%;
    left: 0%;
    opacity: 0.1;
}

.sq-2 {
    width: 30px;
    height: 30px;
    background: var(--accent-cyan);
    top: 14%;
    left: 8%;
    opacity: 0.25;
}

.sq-3 {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.7);
    top: 28%;
    left: 2%;
    opacity: 0.2;
}

.sq-4 {
    width: 25px;
    height: 25px;
    background: var(--accent-green);
    top: 42%;
    left: 10%;
    opacity: 0.3;
}

.sq-5 {
    width: 90px;
    height: 90px;
    background: var(--accent-cyan);
    top: 55%;
    left: 0%;
    opacity: 0.1;
}

.sq-6 {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.7);
    top: 70%;
    left: 6%;
    opacity: 0.25;
}

.sq-7 {
    width: 150px;
    height: 150px;
    background: var(--accent-green);
    top: 82%;
    left: 1%;
    opacity: 0.1;
}

.sq-8 {
    width: 22px;
    height: 22px;
    background: var(--accent-cyan);
    top: 92%;
    left: 12%;
    opacity: 0.3;
}

/* Lato destro */
.sq-9 {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.7);
    top: 5%;
    left: 90%;
    opacity: 0.15;
}

.sq-10 {
    width: 25px;
    height: 25px;
    background: var(--accent-green);
    top: 18%;
    left: 93%;
    opacity: 0.3;
}

.sq-11 {
    width: 130px;
    height: 130px;
    background: var(--accent-cyan);
    top: 30%;
    left: 88%;
    opacity: 0.1;
}

.sq-12 {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.7);
    top: 45%;
    left: 92%;
    opacity: 0.2;
}

.sq-13 {
    width: 30px;
    height: 30px;
    background: var(--accent-green);
    top: 58%;
    left: 95%;
    opacity: 0.25;
}

.sq-14 {
    width: 100px;
    height: 100px;
    background: var(--accent-cyan);
    top: 68%;
    left: 89%;
    opacity: 0.1;
}

.sq-15 {
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.7);
    top: 80%;
    left: 94%;
    opacity: 0.3;
}

.sq-16 {
    width: 70px;
    height: 70px;
    background: var(--accent-green);
    top: 90%;
    left: 87%;
    opacity: 0.15;
}

/* Sparsi ma fuori centro */
.sq-17 {
    width: 45px;
    height: 45px;
    background: var(--accent-cyan);
    top: 35%;
    left: 18%;
    opacity: 0.1;
}

.sq-18 {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.7);
    top: 65%;
    left: 78%;
    opacity: 0.15;
}

/* Tutto il contenuto sopra i quadrati */
header,
section,
form,
footer,
.success-message,
.error-message,
.deadline {
    position: relative;
    z-index: 1;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 32, 100, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    padding: 36px 40px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.modal-message {
    font-size: 17px;
    color: var(--main-color);
    margin: 0 0 28px;
    line-height: 1.5;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.2s;
    margin: 0;
}

.modal-cancel {
    background: #e0e4e8;
    color: var(--main-color);
}

.modal-cancel:hover {
    background: #cdd3d9;
    color: var(--main-color);
}

.modal-confirm {
    background: var(--accent-green);
    color: #fff;
}

.modal-confirm:hover {
    background: #3a9636;
    color: #fff;
}

/* Word cleanup */
.MsoListParagraph,
.MsoListParagraphCxSpFirst,
.MsoListParagraphCxSpMiddle,
.MsoListParagraphCxSpLast,
.editor-content p.MsoListParagraph {
    text-indent: 0 !important;
    margin: 0 0 1em !important;
}