/* Stili pagina Data Request (GDPR Form) */
/* File: /assets/css/pages/data-request.css */

/* Skip Link - WCAG 2.2 AA */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus visibile globale - WCAG 2.2 AA */
.form-container *:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 3px;
}

/* Form Container */
.form-container {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

/* Header */
.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header h1 {
    color: #0056b3;
    margin-bottom: 8px;
    font-size: 1.8rem;
}

.form-header .subtitle {
    color: #596068;
    font-size: 0.95rem;
    margin: 0;
}

/* Info Box */
.info-box {
    background: #f8f9fa;
    border-left: 4px solid #0056b3;
    padding: 18px 20px;
    margin-bottom: 28px;
    border-radius: 4px;
}

.info-box h2 {
    color: #333;
    font-size: 1rem;
    margin: 0 0 12px;
}

.info-box ul {
    margin: 0;
    padding-left: 20px;
}

.info-box li {
    color: #555;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

/* Fix Firefox mobile: previene spaziatura eccessiva */
.form-container p,
.form-container li,
.info-box p,
.info-box li {
    text-align: left;
}

/* Form groups */
.form-group {
    margin-bottom: 24px;
    border: none;
    padding: 0;
}

.form-group label,
.form-group legend {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.required {
    color: #dc3545;
    margin-left: 2px;
}

.optional {
    color: #596068;
    font-weight: 400;
    font-size: 0.85rem;
}

/* Input e textarea */
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    background: #fff;
    color: #333;
}

.form-group input[type="email"]:focus,
.form-group textarea:focus {
    border-color: #0066cc;
    outline: 3px solid #0066cc;
    outline-offset: 0;
}

.form-group input[readonly] {
    background: #f8f9fa;
    color: #555;
    cursor: default;
}

.form-group textarea {
    resize: vertical;
    min-height: 110px;
}

.help-text {
    font-size: 0.85rem;
    color: #596068;
    margin: 5px 0 0;
}

/* Fieldset radio */
fieldset.form-group {
    margin: 0 0 24px;
    padding: 0;
    border: none;
}

fieldset.form-group legend {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95rem;
    float: left;
    width: 100%;
}

/* Radio group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    clear: both;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
}

.radio-option:hover {
    background: #f8f9fa;
    border-color: #0056b3;
}

.radio-option.selected {
    background: #e7f1ff;
    border-color: #0056b3;
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    margin-top: 4px;
    cursor: pointer;
    accent-color: #0056b3;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.radio-label {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
}

.radio-label strong {
    display: block;
    margin-bottom: 3px;
    color: #333;
    font-size: 0.95rem;
}

.radio-label small {
    color: #596068;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

/* Pulsanti */
.btn {
    display: inline-block;
    padding: 11px 28px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary {
    background: #0056b3;
    color: #fff;
}

.btn-primary:hover {
    background: #003d7a;
    color: #fff;
}

.btn-primary:disabled {
    background: #5a7fa8;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #545b62;
    color: #fff;
}

/* Login required box - utenti non loggati */
.login-required-box {
    background: #fff3cd;
    border: 2px solid #c89f2d;
    border-radius: 6px;
    padding: 28px 24px;
    margin-bottom: 28px;
    text-align: center;
}

.login-required-box__text {
    color: #594b00;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.5;
    margin: 0 0 18px;
}

.btn-login-required {
    background: #0056b3;
    color: #fff;
    font-size: 1.15rem;
    padding: 14px 36px;
    border-radius: 6px;
}

.btn-login-required:hover {
    background: #003d7a;
    color: #fff;
    text-decoration: none;
}

.btn-login-required:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 3px;
}

/* Alert */
.alert {
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.alert-error {
    background: #f8d7da;
    color: #58151c;
    border: 1px solid #f5c6cb;
}

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

/* Link footer */
.links {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.links a {
    color: #0056b3;
    text-decoration: none;
    margin: 0 12px;
    font-size: 0.9rem;
}

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

/* Contatore caratteri in esaurimento */
.char-count--warning {
    color: #b02a37;
}

/* ===================== */
/* RESPONSIVE            */
/* ===================== */
@media (max-width: 768px) {
    .form-container {
        max-width: 100%; /* Fix: usa tutta la larghezza disponibile su mobile */
        padding: 20px 12px;
        margin: 0; /* Fix: rimuove margine che restringe il contenuto */
        border-radius: 0; /* Nessun bordo arrotondato a pieno schermo */
        box-shadow: none; /* Rimuove ombra inutile su mobile */
    }

    .form-header h1 {
        font-size: 1.4rem;
    }

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

    .btn {
        width: 100%;
        padding: 12px;
    }

    .radio-option {
        padding: 10px;
    }

    .links a {
        display: inline-block;
        margin: 6px 8px;
    }
}

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

    .info-box {
        padding: 14px 12px;
    }

    .login-required-box {
        padding: 20px 14px;
    }
}
