/* =========================================================================
 * ARBIMASTER - REGISTER STYLES
 * File: assets/css/register-styles.css
 * Versione: 2.0 - Modulare e ottimizzata
 * ========================================================================= */

/* === LAYOUT PRINCIPALE === */
.register-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: calc(100vh - 80px);
    padding: 40px 0;
    position: relative;
    overflow: hidden;
}

/* === BACKGROUND EFFECTS === */
.register-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.floating-shape {
    position: absolute;
    opacity: 0.1;
    animation: floatShape 8s ease-in-out infinite;
}

.floating-shape:nth-child(1) {
    top: 20%;
    left: 15%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #60a5fa, #3b82f6);
    border-radius: 50%;
    animation-delay: 0s;
}

.floating-shape:nth-child(2) {
    top: 70%;
    right: 20%;
    width: 150px;
    height: 150px;
    background: linear-gradient(45deg, #a855f7, #8b5cf6);
    border-radius: 30px;
    animation-delay: 3s;
}

.floating-shape:nth-child(3) {
    bottom: 20%;
    left: 40%;
    width: 180px;
    height: 180px;
    background: conic-gradient(#ec4899, #f472b6, #ec4899);
    border-radius: 50%;
    animation-delay: 6s;
}

@keyframes floatShape {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
        opacity: 0.1;
    }
    50% { 
        transform: translateY(-30px) rotate(180deg); 
        opacity: 0.2;
    }
}

/* === HEADER HERO === */
.register-hero {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.register-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.register-hero p {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.9);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.gradient-text { 
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    background-clip: text; 
}

/* === FORM CARD === */
.register-card {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border-radius: 24px;
    position: relative;
    z-index: 1;
}

.register-card-header {
    text-align: center;
    padding: 32px 32px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.register-card-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.register-card-header p {
    color: #6b7280;
    font-size: 1rem;
}

/* === FORM STYLES === */
.register-form {
    padding: 32px;
    space-y: 24px;
}

.form-input {
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
    transform: translateY(-1px);
}

.form-input.valid {
    border-color: #10b981;
    background: #f0fdf4;
}

.form-input.invalid {
    border-color: #ef4444;
    background: #fef2f2;
}

/* === VALIDATION STATES === */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-label .required {
    color: #ef4444;
    margin-left: 2px;
}

.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    transition: color 0.3s ease;
    pointer-events: none;
}

.form-input:focus + .input-icon,
.form-input.valid + .input-icon {
    color: #667eea;
}

.form-input.invalid + .input-icon {
    color: #ef4444;
}

.input-with-icon {
    padding-left: 48px;
}

.validation-message {
    font-size: 12px;
    margin-top: 6px;
    display: block;
    font-weight: 500;
}

.validation-message.success {
    color: #10b981;
}

.validation-message.error {
    color: #ef4444;
}

/* === PASSWORD STRENGTH === */
.password-strength {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

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

.strength-weak { 
    background: #ef4444; 
    width: 25%; 
}

.strength-fair { 
    background: #f59e0b; 
    width: 50%; 
}

.strength-good { 
    background: #10b981; 
    width: 75%; 
}

.strength-strong { 
    background: #059669; 
    width: 100%; 
}

/* === CAPTCHA === */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.captcha-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 16px 24px;
    border-radius: 8px;
    text-align: center;
    letter-spacing: 4px;
    user-select: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    min-width: 120px;
}

.captcha-input {
    flex: 1;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: bold;
    letter-spacing: 2px;
}

/* === SUBMIT BUTTON === */
.btn-register {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-register::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-register:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-register:hover:not(:disabled)::before {
    left: 100%;
}

.btn-register:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === TERMS CHECKBOX === */
.terms-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.terms-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #d1d5db;
    accent-color: #667eea;
    margin-top: 2px;
    flex-shrink: 0;
}

.terms-text {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
}

.terms-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.terms-link:hover {
    text-decoration: underline;
}

/* === ALERTS === */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-critical {
    background-color: #fef2f2;
    color: #991b1b;
    border: 2px solid #f87171;
}

.alert svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* === FOOTER LINKS === */
.register-footer {
    text-align: center;
    padding: 24px 32px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.register-footer p {
    color: #6b7280;
    font-size: 14px;
}

.register-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

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

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .register-section {
        padding: 20px 16px;
    }
    
    .register-hero h1 {
        font-size: 2.25rem;
    }
    
    .register-hero p {
        font-size: 1.125rem;
    }
    
    .register-card {
        border-radius: 20px;
        margin: 0;
    }
    
    .register-form {
        padding: 24px;
    }
    
    .captcha-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .captcha-box {
        font-size: 1.25rem;
        padding: 12px;
    }
    
    .floating-shape {
        display: none;
    }
}

@media (max-width: 480px) {
    .register-hero h1 {
        font-size: 1.875rem;
    }
    
    .register-card-header {
        padding: 24px 20px 16px;
    }
    
    .register-form {
        padding: 20px;
    }
    
    .form-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .btn-register {
        padding: 14px;
        font-size: 1rem;
    }
}

/* === DARK MODE === */
@media (prefers-color-scheme: dark) {
    .register-card {
        background: rgba(31, 41, 55, 0.95);
        border-color: rgba(75, 85, 99, 0.3);
    }
    
    .register-card-header h2 {
        color: #f9fafb;
    }
    
    .register-card-header p {
        color: #d1d5db;
    }
    
    .form-input {
        background: rgba(55, 65, 81, 0.5);
        border-color: rgba(75, 85, 99, 0.5);
        color: white;
    }
    
    .form-label {
        color: #f3f4f6;
    }
    
    .terms-container {
        background: rgba(75, 85, 99, 0.2);
        border-color: rgba(75, 85, 99, 0.3);
    }
    
    .terms-text {
        color: #d1d5db;
    }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    .floating-shape,
    .form-input,
    .btn-register {
        animation: none;
        transition: none;
    }
    
    .btn-register::before {
        display: none;
    }
}

/* === HIGH CONTRAST === */
@media (prefers-contrast: high) {
    .register-card {
        border: 3px solid #000;
        background: #fff;
    }
    
    .form-input {
        border: 2px solid #000;
        background: #fff;
    }
    
    .btn-register {
        background: #000;
        border: 2px solid #000;
    }
}

/* === FOCUS MANAGEMENT === */
.form-input:focus,
.btn-register:focus,
.terms-checkbox:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}