/* File: assets/css/spid-pages.css */
/* Stili per le pagine dedicate SPID (login, callback, test) */

* {
    box-sizing: border-box;
}

body.spid-page {
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.spid-page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Login Page Styles */
.spid-login-container {
    background: white;
    /* #border-radius: 12px; */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 40px;
}

.spid-header {
    text-align: center;
    margin-bottom: 40px;
}

.spid-header h1 {
    color: #000;
    margin-bottom: 10px;
    font-size: 2.2em;
    font-weight: 700;
}

.spid-header p {
    color: #000;
    font-size: 1.1em;
    margin: 0;
}

.spid-access-simple {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: #f8f9fa;
    /* #border-radius: 8px;
    #border-left: 4px solid #0066cc; */
}

.spid-access-simple h2 {
    color: #0066cc;
    margin-bottom: 15px;
}

.spid-divider {
    text-align: center;
    position: relative;
    margin: 30px 0;
}

.spid-divider:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}

.spid-divider span {
    background: white;
    padding: 0 20px;
    color: #666;
    font-weight: bold;
    position: relative;
}

.spid-provider-selection h2 {
    color: #0066cc;
    margin-bottom: 20px;
}

.spid-providers-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.spid-section,
.cie-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
}

.spid-section h3,
.cie-section h3 {
    margin-top: 0;
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 20px;
    color: #0066cc;
    font-weight: bold;
}

.cie-section h3 {
    color: #28a745;
}

.spid-providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.spid-provider-form,
.cie-provider-form {
    margin: 5px 0;
}

.spid-provider-button {
    width: 100%;
    padding: 12px 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.spid-provider-button:hover {
    border-color: #0066cc;
    background: #f0f8ff;
    color: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.15);
}

.cie-provider-button {
    width: 100%;
    padding: 15px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.cie-provider-button:hover {
    background: #1e7e34;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
}

/* Advanced Options */
.spid-advanced-options {
    margin-top: 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0;
    background: #f8f9fa;
}

.spid-advanced-options summary {
    padding: 15px 20px;
    cursor: pointer;
    font-weight: bold;
    background: #e9ecef;
    border-radius: 8px 8px 0 0;
    transition: background 0.3s;
}

.spid-advanced-options summary:hover {
    background: #dee2e6;
}

.spid-advanced-options[open] summary {
    border-radius: 8px 8px 0 0;
}

.advanced-form {
    padding: 20px;
}

.spid-form-table {
    width: 100%;
    border-collapse: collapse;
}

.spid-form-table td {
    padding: 10px;
    vertical-align: top;
}

.spid-form-table label {
    font-weight: bold;
    color: #495057;
}

.spid-form-table select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

/* Buttons */
.spid-button {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    /* #border-radius: 6px; */
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

.spid-button-primary {
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: white;
}

.spid-button-primary:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003366 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 102, 204, 0.3);
}

.spid-button-secondary {
    background: #6c757d;
    color: white;
}

.spid-button-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.spid-button-test {
    background: #ffc107;
    color: #212529;
}

.spid-button-test:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

/* Test Section */
.spid-test-section {
    background: #fff3cd;
    padding: 20px;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    margin-top: 30px;
}

.spid-test-section h3 {
    margin-top: 0;
    color: #856404;
}

/* Info Section */
.spid-info-section {
    margin-top: 40px;
    background: #e7f3ff;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #0066cc;
}

.spid-info-section h3 {
    color: #0066cc;
    margin-top: 0;
}

.spid-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.info-item {
    background: white;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-item h4 {
    margin-top: 0;
    color: #0066cc;
    font-size: 1.2em;
}

.info-item a {
    color: #0066cc;
    text-decoration: none;
    font-weight: bold;
}

.info-item a:hover {
    text-decoration: underline;
}

/* Redirect Page */
.spid-redirect-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 60px 40px;
    text-align: center;
}

.spid-redirect-content {
    margin-bottom: 40px;
}

.spid-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spid-redirect-content h2 {
    color: #000;
    margin-bottom: 15px;
}

/* Callback Pages */
.spid-callback-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 40px;
    text-align: center;
}

.spid-success {
    color: #155724;
}
.spid-success .user-info .data-item{
    color: #000;
}
.spid-error {
    color: #721c24;
}

.spid-no-data {
    color: #856404;
}

.success-icon,
.error-icon,
.warning-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.spid-success h1 {
    color: #991636;
    margin-bottom: 15px;
}

.spid-error h1 {
    color: #721c24;
    margin-bottom: 15px;
}

.spid-no-data h1 {
    color: #856404;
    margin-bottom: 15px;
}

.success-message,
.error-message {
    font-size: 1.1em;
    margin-bottom: 30px;
}

.user-info {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin: 25px 0;
    text-align: left;
}

.user-info h3 {
    margin-top: 0;
    color: #991636;
    text-align: center;
}

.user-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.data-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #991636;
}

.success-actions,
.error-actions,
.no-data-actions {
    margin-top: 30px;
}

.success-actions .spid-button,
.error-actions .spid-button,
.no-data-actions .spid-button {
    margin: 0 10px 10px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .spid-page-container {
        padding: 10px;
    }
    
    .spid-login-container,
    .spid-redirect-container,
    .spid-callback-container {
        padding: 20px;
    }
    
    .spid-providers-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .spid-providers-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .spid-info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .user-data-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .spid-header h1 {
        font-size: 1.8em;
    }
    
    .spid-button {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .success-actions .spid-button,
    .error-actions .spid-button,
    .no-data-actions .spid-button {
        margin: 0 0 10px 0;
    }
}

@media (max-width: 480px) {
    .spid-login-container,
    .spid-redirect-container,
    .spid-callback-container {
        padding: 15px;
        border-radius: 8px;
    }
    
    .spid-access-simple {
        padding: 20px;
    }
    
    .spid-section,
    .cie-section {
        padding: 15px;
    }
}

/* Print Styles */
@media print {
    body.spid-page {
        background: white;
    }
    
    .spid-login-container,
    .spid-redirect-container,
    .spid-callback-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .spid-button {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .spid-provider-button {
        border-width: 3px;
    }
    
    .spid-button {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .spid-spinner {
        animation: none;
        border-top-color: transparent;
    }
}

/* Focus Styles for Accessibility */
.spid-button:focus,
.spid-provider-button:focus,
.cie-provider-button:focus {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.spid-button:focus:not(:focus-visible),
.spid-provider-button:focus:not(:focus-visible),
.cie-provider-button:focus:not(:focus-visible) {
    outline: none;
}