/* header */

body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: sans-serif;
}

header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.7px solid #ccc;
    background-color: white;
    padding-top : 15px;
    padding-bottom: 15px;
    padding-right: 70px;
    padding-left: 70px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: sticky;
    top: 0;
    z-index: 1000;
}


header .header-img {
    width: 160px;
    height: auto;
    transition: transform 0.3s ease;
}

header .header-img:hover {
    transform: scale(1.05);
}

header .ls {
    list-style-type: none;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

header .ls ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    gap: 20px;
}

header .ls li {
    list-style-type: none;
    display: flex;
    align-items: center;
}

header .ls li:not(:last-child) {
    cursor: pointer;
    transition: color 0.3s ease;
}

header .ls li:not(:last-child):hover {
    color: #1C4D8D;
}

header .ls li a {
    text-decoration: none;
    color: inherit;
}

header .ls li button {
    cursor: pointer;
    color: white;
    background-color: #1C4D8D;
    width: 100px;
    height: 40px;
    border: none;
    outline: none;
}

/*hero*/

main{
    width: 100%;
}

.cointener{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.hero{
    width: 50%;
    padding-left: 70px;
    padding-right: 70px;
    padding-top : 90px;
    padding-bottom: 90px;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1C4D8D;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero h2{
    font-size: 2rem;
    font-weight: 700;
    color: #1C4D8D;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p{
    color: #6c757d;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 30px;
    font-weight: normal;
}

.hero .inizia{
    cursor: pointer;
    color: white;
    background-color: #1C4D8D;
    width: 140px;
    height: 40px;
    border: none;
    outline: none;
    margin-right: 15px;
    transition: background-color 0.3s ease;
}

.hero .inizia:hover {
    background-color: #153a6b;
}

.hero .scopri{
    cursor: pointer;
    color: black;
    background-color: #ffffff;
    width: 140px;
    height: 40px;
    border: 0.7px solid #ccc;
    outline: none;
    transition: border-color 0.3s ease;
}

.hero .inizia a,
.hero .scopri a {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero .scopri:hover {
    border-color: #1C4D8D;
}

.hero-img{
    width: 50%;
    padding-left: 70px;
    padding-right: 70px;
    padding-top : 90px;
    padding-bottom: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Section Divider */
.section-divider {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 1px;
    background-color: #e9ecef;
    margin: 0;
}

/* Norme page specific section divider */
.norme-content .section-divider {
    width: 100%;
    margin-left: 0;
}

/* Login Modal */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 24px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    border: 1px solid #1C4D8D;
    border-radius: 0px;
    box-shadow: none;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    max-height: 90vh;
    overflow: auto;
}

#registerModal .modal-content,
#profileModal .modal-content {
    max-width: 520px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-body {
    text-align: left;
}

.modal-header h2 {
    color: #1C4D8D;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
}

.close-modal:focus-visible {
    outline: 2px solid #1C4D8D;
    outline-offset: 3px;
}

.close-modal:hover {
    color: #1C4D8D;
}

.login-error {
    display: none;
    color: #b00020;
    background: #fff2f2;
    border: 1px solid #b00020;
    border-radius: 0px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    box-sizing: border-box;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.form-group label {
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 0px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.form-group select {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 0px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    background: white;
}

.form-group input::placeholder {
    color: #9aa3ab;
}

.form-group input:focus {
    outline: none;
    border-color: #1C4D8D;
}

.form-group select:focus {
    outline: none;
    border-color: #1C4D8D;
}

.form-group input:focus-visible,
.form-group select:focus-visible {
    box-shadow: 0 0 0 3px rgba(28, 77, 141, 0.18);
}

.login-btn {
    background-color: #1C4D8D;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 0px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

.login-btn:focus-visible {
    outline: 2px solid #1C4D8D;
    outline-offset: 3px;
}

.login-btn:hover {
    background-color: #153a6b;
}

.register-link {
    margin-top: 20px;
    text-align: center;
}

.register-link p {
    margin: 0;
    color: #2c3e50;
}

.register-link a {
    color: #1C4D8D;
    text-decoration: none;
    font-weight: 600;
}

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

/* Dashboard (Calcolo) */
.dashboard-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(28, 77, 141, 0.25);
    margin-bottom: 18px;
}

.dashboard-welcome {
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
}

.dashboard-logout {
    background: none;
    border: none;
    color: #1C4D8D;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 10px;
}

.dashboard-logout:hover {
    text-decoration: underline;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    align-items: start;
    padding: 12px 0 40px;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-nav-btn {
    width: 100%;
    text-align: left;
    background: linear-gradient(180deg, #1C4D8D 0%, #153a6b 100%);
    color: white;
    border: 1px solid #1C4D8D;
    border-radius: 0px;
    padding: 12px 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.2px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

.dashboard-nav-btn:not(.is-active) {
    opacity: 0.92;
}

.dashboard-nav-btn.is-active {
    outline: 2px solid rgba(28, 77, 141, 0.35);
    outline-offset: 2px;
}

.dashboard-nav-btn:hover {
    background: linear-gradient(180deg, #1a4681 0%, #12325d 100%);
}

.dashboard-card {
    border: 1px solid rgba(28, 77, 141, 0.5);
    background: white;
    border-radius: 0px;
}

.dashboard-card-inner {
    padding: 18px;
}

.dashboard-card .form-group label {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.2px;
}

.dashboard-card select,
.dashboard-card input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(44, 62, 80, 0.25);
    border-radius: 0px;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card select:focus,
.dashboard-card input:focus {
    outline: none;
    border-color: #1C4D8D;
    box-shadow: 0 0 0 4px rgba(28, 77, 141, 0.12);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 18px;
    margin-top: 14px;
    align-items: start;
}

.dashboard-preview {
    border-left: 1px solid rgba(28, 77, 141, 0.25);
    padding-left: 16px;
}

.dashboard-preview-title {
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 13px;
}

.dashboard-preview-body {
    font-size: 13px;
    line-height: 1.5;
    color: #2c3e50;
    background: #f8fbff;
    border: 1px solid rgba(28, 77, 141, 0.25);
    padding: 12px;
    border-radius: 0px;
    min-height: 180px;
}

@media (max-width: 980px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-preview {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(28, 77, 141, 0.25);
        padding-top: 14px;
    }
}
.card-container-wrapper {
    position: relative;
    padding: 60px 70px;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #1C4D8D;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.carousel-nav:hover {
    background-color: #153a6b;
}

.carousel-nav.prev {
    left: 20px;
}

.carousel-nav.next {
    right: 20px;
}

/* Carousel Cards */
.card-container {
    display: flex;
    gap: 30px;
    overflow-x: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.card-container-slogan {
    width: 100%;
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 20px;
}

.card-container-slogan::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #1C4D8D;
    border-radius: 2px;
}

.card-container::after {
    content: '';
    min-width: 70px;
    height: 1px;
}

.card-container::-webkit-scrollbar {
    height: 8px;
}

.card-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.card-container::-webkit-scrollbar-thumb {
    background: #1C4D8D;
    border-radius: 10px;
}

.card {
    min-width: 350px;
    height: 300px;
    scroll-snap-align: start;
    background: white;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.card-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    text-transform: capitalize;
    text-align: center;
}

.divider {
    width: 100%;
    height: 1px;
    background-color: #e9ecef;
    margin: 15px 0;
}

.card p {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
    text-align: center;
    max-width: 280px;
}

.card-link {
    color: #1C4D8D;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
    margin-top: 20px;
}

.card-link:hover {
    color: #153a6b;
}

/* Contact Section */
.contattaci {
    padding: 60px 70px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.contattaci h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 20px;
}

.contattaci h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #1C4D8D;
    border-radius: 2px;
}

.contact-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 200px;
    max-width: 1000px;
    margin: 0 auto;
}

.cont-form {
    flex: 1;
}

.contact-form input,
.contact-form select {
    width: 100%;
    height: 50px;
    padding: 15px;
    border: 1px solid #e9ecef;
    background: white;
    font-size: 16px;
    color: #2c3e50;
    outline: none;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.contact-form input:focus,
.contact-form select:focus {
    border-color: #1C4D8D;
}

.contact-form button {
    background-color: #1C4D8D;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    align-self: center;
}

.contact-form button:hover {
    background-color: #153a6b;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
    justify-content: center;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-item .icon {
    font-size: 20px;
    color: #1C4D8D;
}

.info-item p {
    font-size: 16px;
    color: #2c3e50;
    margin: 0;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 15px;
    background: transparent;
    border: none;
    border-radius: 0px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.user-btn:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #1A535C;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 40px;
}

.user-avatar i {
    color: #ffffff;
    font-size: 20px;
}

.user-welcome-text {
    font-family: Montserrat, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    text-transform: capitalize;
    white-space: nowrap;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #1C4D8D;
    border-radius: 0;
    box-shadow: none;
    z-index: 1000;
    min-width: 140px;
}

.user-dropdown-menu button {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    text-align: left;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s;
}

.user-dropdown-menu button:hover {
    background-color: rgba(28, 77, 141, 0.1);
    color: #1C4D8D;
}

/* Footer */
footer {
    background-color: #1C4D8D;
    padding: 20px 0;
    margin-top: 0;
}

.footer-content {
    text-align: center;
    padding: 0 70px;
}

.footer-content p {
    color: white;
    font-size: 14px;
    margin: 0;
}

/* Norme Page Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 70px;
}

.norme-content {
    padding: 40px 0;
    display: flex;
    flex-direction: column;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.card-norme {
    width: 90%;
    height: auto;
    background: white;
    scroll-snap-align: start;
    background: white;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 0 auto 30px auto;
}

.card-norme h2 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    text-transform: capitalize;
    text-align: center;
}


.card-norme .divider {
    width: 100%;
    height: 1px;
    background-color: #e9ecef;
    margin: 15px 0;
}

.card-norme p {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    text-align: left;
    max-width: 100%;
}

.card-norme ul {
    margin: 15px 0;
    padding-left: 20px;
    width: 100%;
    text-align: left;
}

.card-norme li {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.calcola-section {
    padding: 40px 0 60px 0;
}

.calcola-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.calcola-subtitle {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 30px 0;
}

.calcola-card {
    max-width: 720px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #1C4D8D;
    border-radius: 0px;
    box-shadow: none;
    padding: 30px;
    box-sizing: border-box;
}

.calcola-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.calcola-grid .form-group {
    margin: 0;
}

.calcola-card select,
.calcola-card input {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 0px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.calcola-card select:focus,
.calcola-card input:focus {
    outline: none;
    border-color: #1C4D8D;
}

.calcola-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.btn-primary {
    flex: 1;
    background-color: #1C4D8D;
    color: #ffffff;
    border: none;
    border-radius: 0px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #153a6b;
}

.btn-secondary {
background: #ffffff;
color: #1C4D8D;
border: 1px solid #1C4D8D;
border-radius: 0px;
padding: 12px 14px;
font-weight: 700;
cursor: pointer;
transition: background-color 0.3s ease;
}

.btn-secondary:focus {
outline: none;
box-shadow: 0 0 0 4px rgba(28, 77, 141, 0.12);
}

.btn-secondary:hover {
background-color: #f3f6fb;
}

.calcola-result {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid #e9ecef;
    border-radius: 0px;
    background: #ffffff;
    text-align: left;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.6;
    box-sizing: border-box;
}

@media (max-width: 820px) {
    .calcola-grid {
        grid-template-columns: 1fr;
    }

    .calcola-actions {
        flex-direction: column;
    }
}
