/* ==========================================================================
   Belltron Cloud - foglio di stile condiviso da tutte le pagine
   (login, registrazione, reset password).
   ========================================================================== */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variabili */
:root {
    --primary-color: #ff9900;
    --primary-dark: #cc7a00;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #ddd;
    --bg-light: #f5f5f5;
    --white: #fff;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-strong: rgba(0, 0, 0, 0.2);
    --success: #27ae60;
    --error: #e74c3c;
    --warning: #f39c12;
    --page-bg: #4a4a4a;
}

/* Layout */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--page-bg);
    min-height: 100vh;
    padding: 20px;
}

/* Centratura verticale (registrazione / reset password) */
body.body-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.body-centered > .container {
    margin-top: auto;
    margin-bottom: auto;
}

.container {
    width: 100%;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
    transition: filter 0.3s ease;
}

.logo-container:hover {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
}

.logo-container img {
    max-width: 280px;
    height: auto;
}

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--white);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.1);
}

.input-wrapper.error {
    border-color: var(--error);
}

.input-wrapper.success {
    border-color: var(--success);
}

.input-icon {
    padding: 0 15px;
    color: var(--text-light);
    font-size: 18px;
}

.form-control {
    flex: 1;
    min-width: 0;
    border: none;
    padding: 13px 15px;
    font-size: 15px;
    outline: none;
    background: transparent;
    color: var(--text-dark);
}

.toggle-password {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 15px;
    font-size: 18px;
    transition: color 0.2s ease;
}

.toggle-password:hover,
.toggle-password:focus-visible {
    color: var(--primary-color);
}

/* Nasconde l'icona occhio nativa di Edge, Chrome e Safari */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="text"]::-ms-reveal,
input[type="text"]::-ms-clear {
    display: none !important;
}

input::-webkit-credentials-auto-fill-button,
input::-webkit-textfield-decoration-container {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Bottoni e link
   -------------------------------------------------------------------------- */
.btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-strong);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-block {
    width: 100%;
}

.link {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.2s ease;
}

.link:hover,
.link:focus-visible {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Banner consenso cookie
   -------------------------------------------------------------------------- */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 20px;
    box-shadow: 0 -4px 20px var(--shadow);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.cookie-consent.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 250px;
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.6;
}

.cookie-text a {
    color: var(--primary-color);
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

.btn-cookie {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-accept {
    background: var(--primary-color);
    color: var(--white);
}

.btn-accept:hover {
    background: var(--primary-dark);
}

.btn-decline {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-decline:hover {
    background: var(--bg-light);
}

/* --------------------------------------------------------------------------
   Selettore lingua (tendina)
   -------------------------------------------------------------------------- */
.language-select {
    min-width: 190px;
    max-width: 240px;
    padding: 9px 40px 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-dark);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.language-select:hover {
    border-color: rgba(255, 153, 0, 0.8);
}

.language-select:focus-visible {
    outline: none;
    border-color: #ff9900;
    box-shadow: 0 0 0 2px rgba(255, 153, 0, 0.18);
}

/* --------------------------------------------------------------------------
   Footer di pagina
   -------------------------------------------------------------------------- */
.page-footer {
    width: 100%;
    margin-top: 40px;
    padding: 24px 20px;
    color: #cfcfcf;
    font-size: 12px;
    line-height: 1.9;
    text-align: center;
}

.page-footer p {
    margin: 0;
}

.page-footer a,
.page-footer .link {
    color: #e8e8e8;
    font-size: inherit;
    text-decoration: underline;
    background: none;
    border: none;
    font-family: inherit;
    padding: 0;
    cursor: pointer;
}

.page-footer a:hover,
.page-footer .link:hover {
    color: var(--primary-color);
}

.footer-language {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.footer-language .fa-globe {
    color: #cfcfcf;
    font-size: 13px;
}

.footer-language .language-select {
    min-width: 0;
    width: auto;
    max-width: 200px;
    padding: 5px 28px 5px 10px;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    background-color: transparent;
    background-position: right 9px center;
    color: #e8e8e8;
}

.footer-language .language-select option {
    color: var(--text-dark);
    background: var(--white);
}

.footer-language .language-select:hover {
    border-color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   Modale
   -------------------------------------------------------------------------- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--white);
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s ease;
}

.modal-content h2 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 20px;
}

.modal-content p {
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 10px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    background: none;
    border: none;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --------------------------------------------------------------------------
   Popup (messaggi di esito / errore)
   -------------------------------------------------------------------------- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.popup__icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.popup__title {
    color: var(--text-dark);
    margin-bottom: 12px;
    font-size: 18px;
}

.popup--error .popup__title {
    color: var(--error);
}

.popup--success .popup__title {
    color: var(--success);
}

.popup__text {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: break-word;
}

.popup__btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 30px;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    font-weight: 500;
}

.popup--error .popup__btn {
    background: var(--error);
}

.popup--success .popup__btn {
    background: var(--success);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
    .cookie-content {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-buttons {
        flex-direction: column;
    }

    .language-select {
        min-width: 160px;
        font-size: 13px;
        padding: 8px 36px 8px 12px;
    }
}
