/* ===== RESET & GLOBAL STYLES ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-image: url("../../assets/img/bg.png");
    background-repeat: repeat;
    color: #100c0c;
    line-height: 1.6;
}

/* ===== LAYOUT STRUCTURE ===== */
.wrapper {
    display: flex;
    min-height: calc(100vh - 50px);
}

main {
    flex: 1;
    padding: 20px;
    padding-top: 100px;
    overflow-x: hidden;
}

.container {
    width: 95%;
    max-width: 1300px;
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 0 auto 15px;
}

.title-container {
    width: 100%;
    background-color: #fff;
    padding: 10px 40px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 0 auto 15px;
}


h1, h2 {
    text-align: center;
    color: #F16722;
    margin-bottom: 20px;
}

.title-container h1 {
    margin: 0px;
}


/* ===== NAVIGATION ===== */
.navbar {
    background-color: #100c0c;
    color: #fff;
    padding: 0 40px;
    height: 70px;
    display: flex;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: inherit;
}

.navbar-left {
    flex-shrink: 0;
}

.navbar-logo {
    height: 50px;
}

.navbar-right {
    display: flex;
    align-items: center;
    margin-left: auto;
    height: inherit;
}

.navbar-menu {
    list-style: none;
    display: flex;
    align-items: stretch;
    margin: 0;
    height: inherit;
}

    .navbar-menu li {
        position: relative;
        display: flex;
        flex: 1;
        width: 160px;
        align-items: center;
        height: inherit;
    }

    .navbar-menu a {
        color: #fff;
        text-decoration: none;
        padding: 0 20px;
        height: 100%;
        width: 100%;
        display: flex;
        align-items: center;
        white-space: nowrap;
        border-radius: 0;
        font-weight: bold;
        transition: background 0.2s ease;
        justify-content: center;
    }

        .navbar-menu a:hover,
        .navbar-menu a.active {
            background-color: #F16722;
        }


.has-dropdown:hover .dropdown {
    display: block;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #1a1a1a;
    min-width: 160px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    z-index: 999;
}

    .dropdown li {
        width: 100%;
    }

    .dropdown a {
        display: block;
        padding: 10px 15px;
        color: #fff;
        border-bottom: 1px solid #333;
        white-space: nowrap;
        width: 100%;
    }

        .dropdown a:hover {
            background-color: #F16722;
        }

.logout-form {
    margin-left: 20px;
}

.logout-button {
    background-color: #F16722;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

    .logout-button:hover {
        background-color: #d65515;
    }

/* ===== FORMS ===== */
form {
    width: 100%;
}

form.no-width {
    width: auto;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-big-group {
    display: flex;
    gap: 5px;
    flex-direction: column;
}

.form-col {
    display: flex;
    gap: 5px;
    flex-direction: column;
}

.form-col-group {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 5px;
}

    .form-group label,
    .form-col-group label {
        margin-bottom: 5px;
        font-weight: bold;
    }


form.full-height {
    height: 100%;
}

    form.full-height .form-col {
        height: 100%;
        display: flex;
        flex-direction: column;
    }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="file"],
input[type="date"],
input[type="checkbox"],
select,
textarea {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    width: 100%;
}

textarea {
    resize: vertical;
    min-height: 45px;
    height: 45px;
}

    input[type="text"]:focus,
    input[type="email"]:focus,
    input[type="tel"]:focus,
    input[type="password"]:focus,
    input[type="file"]:focus,
    input[type="date"]:focus,
    input[type="checkbox"]:focus,
    select:focus,
    textarea:focus {
        border-color: #F16722;
        outline: none;
        box-shadow: 0 0 0 2px rgba(241, 103, 34, 0.2);
    }

fieldset.part {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

p.centered {
    margin: auto 0;
}

b {
    color: #F16722;
}

.tabs {
    display: flex;
    flex-direction: column;
}

#tab1, #tab2 {
    display: none;
}

.tab-labels {
    display: flex;
}

.tab-label {
    padding: 12px;
    border: 1px solid #ccc;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    font-size: 16px;
    width: 100%;
    flex: 1;
    background: #eee;
    text-align: center;
    cursor: pointer;
    border-bottom: none;
    transition: background 0.3s;
}

    .tab-label:hover {
        background: #ddd;
    }

input#tab1:checked ~ .tab-labels label[for="tab1"],
input#tab2:checked ~ .tab-labels label[for="tab2"] {
    background: #fff;
    font-weight: bold;
    border-bottom: 1px solid #fff;
}

.tab-content {
    border: 1px solid #ccc;
    padding: 1rem;
    background: #fff;
}

.tab {
    display: none;
}

#tab1:checked ~ .tab-content .tab1,
#tab2:checked ~ .tab-content .tab2 {
    display: block;
}

legend {
    font-weight: bold;
    padding: 0 10px;
    color: #F16722;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

.action-grid-6 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.action-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.action-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.col-12 { grid-column: span 12; }
.col-11 { grid-column: span 11; }
.col-10 { grid-column: span 10; }
.col-9 { grid-column: span 9; }
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }
.col-1 { grid-column: span 1; }

.checkbox-small {
    align-self: center;
    justify-self: start;
    width: auto;
}

.form-grid-row {
    display: contents;
}

.form-grid-group {
    display: flex;
    flex-direction: column;
}

    .form-grid-group label {
        margin-bottom: 5px;
        font-weight: bold;
    }

.aligned-items {
    display: flex;
    gap: 5px;
}

    .aligned-items input {
        flex: 1;
        padding: 1rem;
    }

.error-message {
    width: 95%;
    max-width: 1300px;
    background-color: #ffc9c9;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 0 auto 15px;
    padding: 10px;
    color: #dc3545;
    margin-bottom: 15px;
    text-align: center;
}

.success-message {
    width: 95%;
    max-width: 1300px;
    background-color: #b0f5b6;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 0 auto 15px;
    color: #26872e;
    margin-bottom: 15px;
    text-align: center;
}

/* ===== INTERNSHIP FORM LAYOUT ===== */


.internship-form .radio-group {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
}

    .internship-form .radio-group label {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

/* ===== BUTTONS (STANDARDIZED) ===== */
button,
input[type="submit"],
input[type="reset"],
input[type="button"],
.download-btn,
.a-btn,
.action-buttons button {
    padding: 12px 24px;
    background-color: #F16722;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

    button:hover,
    input[type="submit"]:hover,
    input[type="button"]:hover,
    .download-btn:hover,
    .a-btn:hover,
    .action-buttons button:hover {
        background-color: #d65515;
    }

    button.disabled,
    input[type="submit"].disabled,
    input[type="button"].disabled,
    .download-btn.disabled,
    .a-btn.disabled,
    button:disabled,
    input[type="submit"]:disabled,
    input[type="button"]:disabled,
    .download-btn:disabled,
    .a-btn:disabled {
        pointer-events: none;
        background-color: #ccc;
        color: #666;
        cursor: not-allowed;
        opacity: 0.6;
    }

/* ===== TABLES ===== */
.table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100vw;
    box-sizing: border-box;
}

    .table-container table {
        width: 100%;
        border-collapse: collapse;
        table-layout: auto;
    }

    table.fair {
        table-layout: auto;
        border-collapse: collapse;
    }

        table.fair th,
        table.fair td {
            white-space: nowrap;
            text-align: left;
            padding: 2px;
        }

td.input {
    width: 100%;
    min-width: 100px;
    box-sizing: border-box;
}

thead {
    background-color: #F16722;
    color: white;
}

th, td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th {
    font-weight: bold;
}

div.th-resizable {
    resize: horizontal;
    overflow: auto;
    width: 120px;
    min-width: 100px;
    margin: 0px;
    padding: 12px;
    border-right: 1px solid white;
    display: block;
}

.delete-row-btn {
    width: 100%;
    height: 100%;
}

th.fit, td.fit {
    width: 1%;
    white-space: nowrap;
}

td.check, th.check {
    width: 30px;
    text-align: center;
    padding: 10px;
}

th.check input[type="checkbox"],
td.check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;

    display: block;
    background: #fff;
    border: 1px solid #ccc;
}

th.check input[type="checkbox"]:checked,
td.check input[type="checkbox"]:checked {
  background: #fc8021;
  border-color: #fc8021;
}


tbody tr:nth-child(odd) {
    background-color: #f2f2f2;
}

tbody tr:nth-child(even) {
    background-color: #e6e6e6;
}

tbody tr:hover {
    background-color: #d9d9d9;
}

tbody tr.valid-doc-line {
    background-color: #80C68F;
}

    tbody tr.valid-doc-line:hover {
        background-color: #5fb872;
    }

tbody tr.invalid-doc-line {
    background-color: #fa9491;
}

    tbody tr.invalid-doc-line:hover {
        background-color: #e07d79;
    }

tr.app-state-tests td {
    background-color: #8fcae5;
}

tr.app-state-error td,
tr.doc-state-error td {
    color: white;
    background-color: #333;
}

tr.app-state-valid td,
tr.doc-state-valid td {
    background-color: #80C68F;
}

tr.app-state-invalid td,
tr.doc-state-invalid td {
    background-color: #fa7f7f;
}

tr.app-state-waiting td,
tr.doc-state-waiting td {
    background-color: #fce697;
}

tr.s0 td {
    background-color: #fa7f7f;
}

tr.s1 td {
    background-color: #ff9778;
}

tr.s2 td {
    background-color: #fce697;
}

tr.s3 td {
    background-color: #e7f78d;
}

tr.s4 td {
    background-color: #c2f7a3;
}

tr.s5 td {
    background-color: #9cd9a9;
}

tr.s6 td {
    background-color: #8fcae5;
}

tr.s7 td {
    background-color: #9cd9a9;
}

tr.s8 td {
    background-color: #f39fcd;
}


.header-fields {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin: auto;
}

.header-fields label {
    display: flex;
    flex-direction: column;
}

/* ===== DOCUMENT SPECIFIC ===== */
.document-section {
    margin-bottom: 30px;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 5rem;
    flex-wrap: wrap;
    margin-top: 20px;
}

.document {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7f7f7;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 10px;
}

/* ===== UPLOAD BOXES ===== */
.upload-box {
    background: #f7f7f7;
    border: 2px dashed #ccc;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
}

    .upload-box span {
        margin: auto;
    }

.drop-zone {
    font-size: 16px;
    color: #666;
    padding: 20px;
    width: 100%;
    text-align: center;
}

.upload-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

.full-width {
    width: 100%;
    display: block;
}

/* ===== STATES/PROGRESS ===== */
.state-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.states {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: nowrap;
}

.state {
    color: #aaa;
    font-size: 14px;
    max-width: 150px;
    text-align: center;
}

.current {
    color: #f97316;
    font-weight: 700;
    font-size: 18px;
}

/* ===== FOOTER ===== */
footer {
    background-color: #100c0c;
    height: 50px;
    width: 100%;
}

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;    
    background-image: url("../../assets/img/bg.png");
    background-repeat: repeat;
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

    .login-form .form-group {
        gap: 10px;
    }

    .login-form a {
        text-align: center;
        margin-top: 15px;
        color: #F16722;
        text-decoration: none;
        display: block;
    }

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


/* ===== TESTS SESSIONS ===== */
.tests-container {
    display: flex;
    flex-direction: row;
    gap: 50px;
    justify-content: space-between;
}

.tests-row {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.tests-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pushed-to-bot {
    margin-top: auto;
}

.pushed-to-right {
    margin-left: auto;
}

.flatpickr-calendar {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    width: 100%;
    border-color: #F16722;
    outline: none;
}

.flatpickr-day.today {
    background: #ffceb5;
    color: #F16722;
    border: none;
}
    .flatpickr-day.today:hover,
    .flatpickr-day:hover {
        background: #ffceb5;
        border: solid 1px #F16722;
        color: #F16722;
    }

.flatpickr-day.selected {
    background: #F16722;
    color: white;
    border: solid 1px #F16722;
}

    .flatpickr-day.selected:hover {
        background: #F16722;
        border: solid 1px black;
        color: white;
    }

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
    fill: #F16722;
}

.documents-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    justify-content: space-between;
}

#loadingOverlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #F16722;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 1200px) {
    .internship-form .container {
        width: 95%;
    }
}

@media (max-width: 1024px) {
    .container {
        width: 95%;
        padding: 30px;
    }
}

@media (max-width: 900px) {
    .internship-form .form-columns {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    main {
        margin-left: 0;
        padding-top: 80px;
    }

    nav {
        width: 100%;
        height: auto;
        position: fixed;
        top: 0;
        z-index: 1000;
        padding: 10px;
    }

    .menu-options {
        display: none;
    }

    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .action-buttons {
        gap: 2rem;
    }
}

@media (max-width: 600px) {
    .internship-form .form-row {
        flex-direction: column;
        gap: 10px;
    }

    .internship-form .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }

    .states {
        flex-wrap: wrap;
        gap: 20px;
    }
}