/* Reset e variabili CSS */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-gray: #ecf0f1;
    --dark-gray: #95a5a6;
    --white: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

/* Header */
header {
    background: var(--primary-color);
    color: var(--white);
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header h1 i {
    margin-right: 15px;
    color: var(--secondary-color);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Environment Selector */
.environment-selector {
    padding: 30px;
    background: var(--light-gray);
    border-bottom: 1px solid #ddd;
}

.environment-selector h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-group label {
    flex: 1;
    min-width: 250px;
    padding: 20px;
    background: var(--white);
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.radio-group label:hover {
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.radio-group input[type="radio"]:checked + label {
    border-color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.1);
}

.radio-group label i {
    font-size: 1.5rem;
    margin-right: 10px;
    color: var(--secondary-color);
}

.env-url {
    display: block;
    font-size: 0.9rem;
    color: var(--dark-gray);
    margin-top: 5px;
}

/* Form Sections */
.form-section {
    padding: 30px;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h2 {
    margin-bottom: 25px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
}

.form-section h2 i {
    margin-right: 10px;
    color: var(--secondary-color);
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--dark-gray);
    font-size: 0.9rem;
}

.validation-note {
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid var(--warning-color);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-top: 20px;
}

.validation-note i {
    color: var(--warning-color);
    margin-right: 10px;
}

/* Product Configuration */
.product-config {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 20px;
    position: relative;
}

.product-config h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-config .remove-product {
    background: var(--danger-color);
    color: var(--white);
    border: none;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.product-config .remove-product:hover {
    background: #c0392b;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin: 5px;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--dark-gray);
    color: var(--white);
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #c0392b;
}

/* Form Actions */
.form-actions {
    padding: 30px;
    text-align: center;
    background: var(--light-gray);
    border-top: 1px solid #ddd;
}

/* Results Section */
.results-section {
    padding: 30px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
}

.results-section h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.result-success {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid var(--success-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.result-error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.credential-box {
    background: var(--white);
    border: 2px solid var(--success-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 15px;
}

.credential-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.credential-item:last-child {
    border-bottom: none;
}

.credential-label {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 120px;
}

.credential-value {
    flex: 1;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    margin: 0 10px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.copy-btn {
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.copy-btn:hover {
    background: #2980b9;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
}

/* Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .radio-group label {
        min-width: auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .credential-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .credential-label {
        min-width: auto;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    color: var(--white);
    font-weight: 600;
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.warning {
    background: var(--warning-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
