/* ========================================
   ORDO - STILI LOGIN E REGISTRAZIONE
   ======================================== */

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

html, body {
    min-height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    padding: 20px;
    padding-bottom: 80px;
}

/* ========== SLIDESHOW BACKGROUND ========== */
.slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.slideshow img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.slideshow img.active {
    opacity: 1;
}

.slideshow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 100%);
    z-index: 2;
}

/* ========== CONTAINER LOGIN ========== */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    width: 100%;
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-header .logo-img {
    height: 60px;
    margin-bottom: 15px;
}

.login-header p {
    font-size: 15px;
    color: #666;
}

/* Registrazione container */
.registration-container {
    max-width: 520px;
    text-align: left;
}

/* Brand (per registrazione) */
.brand-logo {
    margin-bottom: 10px;
    text-align: center;
}

.brand-logo img {
    max-height: 60px;
    width: auto;
}

.brand {
    font-size: 28px;
    font-weight: 700;
    color: #FF6B00;
    margin-bottom: 8px;
    text-align: center;
}

.page-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
    text-align: center;
}

/* ========== ALERT MESSAGES ========== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert i {
    font-size: 16px;
}

.alert-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.alert-warning {
    background: #fffbea;
    border: 1px solid #ffc107;
    color: #856404;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* ========== FORM SECTIONS ========== */
.form-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 14px;
    color: #FF6B00;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-section h3 i {
    margin-right: 8px;
}

/* ========== INPUT GROUPS ========== */
.input-group {
    position: relative;
    margin-bottom: 16px;
}

/* Icona dentro input - struttura con div.input-icon */
.input-group .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 15px;
    z-index: 2;
    pointer-events: none;
}

/* Icona dentro input - struttura con i diretto */
.input-group > i:first-child {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 15px;
    z-index: 2;
    pointer-events: none;
}

.input-group input {
    width: 100%;
    padding: 15px 16px 15px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
}

.input-group input:focus {
    outline: none;
    border-color: #FF6B00;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.input-group input::placeholder {
    color: #aaa;
}

/* Toggle password button */
.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 16px;
    padding: 5px;
    transition: color 0.2s;
    z-index: 2;
}

.toggle-password:hover {
    color: #FF6B00;
}

.input-row {
    display: flex;
    gap: 15px;
}

.input-row .input-group {
    flex: 1;
}

/* Password container (per registrazione) */
.password-container {
    position: relative;
}

.password-container input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    font-size: 16px;
    padding: 5px;
    transition: color 0.2s;
    z-index: 2;
    background: none;
    border: none;
}

.password-toggle:hover {
    color: #FF6B00;
}

/* Password strength */
.password-strength {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-requirements {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
}

.password-match {
    font-size: 12px;
    margin-top: 6px;
    min-height: 18px;
}

.match-success {
    color: #2ecc71;
}

.match-error {
    color: #e74c3c;
}

/* ========== BUTTONS ========== */
.btn-login {
    width: 100%;
    padding: 15px;
    background: #FF6B00;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    background: #e55f00;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

button[type="submit"] {
    width: 100%;
    padding: 15px;
    background: #FF6B00;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
    margin-top: 10px;
}

button[type="submit"]:hover:not(:disabled) {
    background: #e55f00;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4);
}

button[type="submit"]:active:not(:disabled) {
    transform: translateY(0);
}

button[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.form-note {
    font-size: 12px;
    color: #999;
    margin-top: 15px;
    text-align: center;
}

/* ========== LOGIN FOOTER ========== */
.login-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 14px;
}

.login-footer a {
    color: #FF6B00;
    text-decoration: none;
    transition: color 0.2s;
}

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

.login-footer .separator {
    color: #ccc;
    margin: 0 12px;
}

/* ========== LINKS ========== */
.forgot-password {
    margin-top: 20px;
    text-align: center;
}

.forgot-password a {
    color: #FF6B00;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.forgot-password a:hover {
    text-decoration: underline;
}

.register-link, .login-link {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.register-link p, .login-link p {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.btn-register {
    display: inline-block;
    background: transparent;
    color: #FF6B00;
    padding: 12px 25px;
    border: 2px solid #FF6B00;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-register:hover {
    background: #FF6B00;
    color: white;
}

.login-link a {
    color: #FF6B00;
    text-decoration: none;
    font-weight: 600;
}

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

/* ========== CONSENSI GDPR ========== */
.consensi-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.consent-item {
    margin-bottom: 15px;
}

.consent-item:last-child {
    margin-bottom: 0;
}

.consent-item.optional {
    opacity: 0.9;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    position: relative;
    padding-left: 32px;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 2px;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-container:hover .checkmark {
    border-color: #FF6B00;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #FF6B00;
    border-color: #FF6B00;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.consent-text {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.consent-text a {
    color: #FF6B00;
    text-decoration: none;
    font-weight: 500;
}

.consent-text a:hover {
    text-decoration: underline;
}

.consent-text .required {
    color: #e74c3c;
    font-weight: bold;
}

.consent-text small {
    color: #999;
    font-style: italic;
}

/* ========== FOOTER LEGALE ========== */
.legal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    gap: 25px;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.legal-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.legal-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Footer con struttura inner (per registrazione) */
.legal-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.legal-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.legal-links a {
    color: #fff;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.legal-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    body {
        padding: 15px;
        padding-bottom: 100px;
    }
    
    .login-box {
        padding: 30px 25px;
    }
    
    .registration-container {
        max-width: 100%;
    }
    
    .brand {
        font-size: 24px;
    }
    
    .input-row {
        flex-direction: column;
        gap: 0;
    }
    
    .legal-footer {
        gap: 15px;
    }
    
    .legal-footer-inner {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .legal-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 25px 20px;
    }
    
    .login-header .logo-img {
        height: 50px;
    }
    
    .brand {
        font-size: 22px;
    }
    
    .input-group input {
        padding: 14px 14px 14px 42px;
        font-size: 14px;
    }
    
    .btn-login,
    button[type="submit"] {
        padding: 14px;
        font-size: 15px;
    }
    
    .consent-text {
        font-size: 12px;
    }
    
    .login-footer .separator {
        display: block;
        margin: 10px 0;
        visibility: hidden;
    }
    
    .login-footer a {
        display: block;
        margin: 5px 0;
    }
}
