/* =====================================================
   GETWEEK - UNIFIED COMPLETE AUTH STYLES
   Compatibile con: Login, Registrazione, Reset Password
   Version: 1.0.0
   ===================================================== */

:root {
    --tc-bg-primary: #0A0A0A;
    --tc-bg-secondary: #1A1A1A;
    --tc-bg-tertiary: #2A2A2A;
    --tc-text-primary: #FFFFFF;
    --tc-text-secondary: #CCCCCC;
    --tc-text-heading: #F5F5F5;
    --tc-accent: #E67E22;
    --tc-accent-hover: #D35400;
    --tc-accent-light: rgba(230, 126, 34, 0.1);
    --tc-accent-glow: rgba(230, 126, 34, 0.6);
    --tc-success: #27AE60;
    --tc-error: #C0392B;
    --tc-warning: #F39C12;
    --tc-border: rgba(255, 255, 255, 0.1);
    --tc-shadow: rgba(0, 0, 0, 0.5);
    --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: var(--tc-bg-primary);
    color: var(--tc-text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
}

/* ===== WRAPPER PRINCIPALE ===== */
.auth-wrapper,
.theclub-registration-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tc-bg-primary);
    position: relative;
    padding: 2rem 1rem;
}

/* ===== SFONDO ANIMATO ===== */
.premium-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse at top, #1a1a1a, #0a0a0a);
    overflow: hidden;
}

.gradient-orbs {
    position: relative;
    width: 100%;
    height: 100%;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #E67E22, #D35400);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #F39C12, #E67E22);
    bottom: -10%;
    right: -10%;
    animation-delay: -10s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #E67E22, #F39C12);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { 
        transform: translate(0, 0) scale(1); 
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}

.floating-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--tc-accent);
    border-radius: 50%;
    opacity: 0;
    animation: particle-float 15s linear infinite;
}

.particle:nth-child(1) {
    left: 20%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    left: 40%;
    animation-delay: -3s;
}

.particle:nth-child(3) {
    left: 60%;
    animation-delay: -6s;
}

.particle:nth-child(4) {
    left: 80%;
    animation-delay: -9s;
}

.particle:nth-child(5) {
    left: 50%;
    animation-delay: -12s;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* ===== CARD AUTH ===== */
.auth-card,
.registration-card {
    max-width: 500px;
    width: 100%;
    padding: 40px 30px;
    background: linear-gradient(145deg, #1E1E1E, #2A2A2A);
    border: 1px solid var(--tc-border);
    border-radius: 24px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

.auth-card-wide {
    max-width: 600px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== HEADER ICONS ===== */
.lock-icon,
.header-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(230,126,34,0.2), rgba(211,84,0,0.2));
    border-radius: 50%;
    color: var(--tc-accent);
    position: relative;
    animation: iconPulse 3s ease-in-out infinite;
}

.header-icon::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tc-accent), transparent);
    opacity: 0.1;
    animation: iconRing 3s ease-in-out infinite;
}

.lock-icon svg,
.header-icon svg {
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 10px var(--tc-accent-glow));
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes iconRing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.2;
    }
}

/* ===== LOGO SECTION ===== */
.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-title {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 4px;
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.glow-text {
    color: #FFFFFF;
    text-shadow: 0 0 20px rgba(255,255,255,0.3);
    animation: pulse-glow 3s ease-in-out infinite;
}

.accent-text {
    background: linear-gradient(135deg, #E67E22, #F39C12, #E67E22);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
    position: relative;
}

@keyframes pulse-glow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(255,255,255,0.3);
    }
    50% {
        text-shadow: 0 0 40px rgba(255,255,255,0.5);
    }
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.logo-subtitle {
    color: var(--tc-text-secondary);
    font-size: 0.95rem;
    margin-top: 10px;
}

/* ===== INPUTS ===== */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    color: var(--tc-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.input-icon svg {
    display: block;
    transition: all var(--transition);
}

.input-group:focus-within .input-icon {
    color: var(--tc-accent);
}

.input-group:focus-within .input-icon svg {
    filter: drop-shadow(0 0 5px var(--tc-accent-glow));
    transform: scale(1.1);
}

.input-prefix {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tc-text-secondary);
    font-weight: 500;
    z-index: 2;
}

.neon-input {
    width: 100%;
    padding: 16px 15px;
    background: var(--tc-bg-primary);
    border: 2px solid var(--tc-border);
    border-radius: 10px;
    color: var(--tc-text-primary);
    font-size: 16px;
    transition: all var(--transition);
}

.input-group .input-icon + .neon-input {
    padding-left: 50px;
}

.phone-input {
    padding-left: 80px !important;
}

.neon-input:focus {
    outline: none;
    border-color: var(--tc-accent);
    background: rgba(230, 126, 34, 0.05);
    box-shadow: 0 0 20px var(--tc-accent-light);
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--tc-accent), var(--tc-accent-hover));
    transition: width var(--transition);
}

.neon-input:focus ~ .input-line {
    width: 100%;
}

.input-helper {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--tc-text-secondary);
    opacity: 0.7;
}

.neon-input:focus ~ .input-helper {
    color: var(--tc-accent);
    opacity: 1;
}

/* ===== TOGGLE PASSWORD ===== */
.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 2;
    transition: all var(--transition);
}

.eye-icon {
    stroke: var(--tc-text-secondary);
    transition: stroke var(--transition);
}

.toggle-password:hover .eye-icon {
    stroke: var(--tc-accent);
}

/* ===== CHECKBOX ===== */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 20px;
    color: var(--tc-text-secondary);
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--tc-border);
    border-radius: 6px;
    position: relative;
    transition: all var(--transition);
    flex-shrink: 0;
}

.checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: var(--tc-accent);
    font-weight: 700;
    transition: transform var(--transition);
}

.checkbox-label input:checked ~ .checkmark {
    background: var(--tc-accent-light);
    border-color: var(--tc-accent);
}

.checkbox-label input:checked ~ .checkmark::after {
    transform: translate(-50%, -50%) scale(1);
}

.checkbox-label a {
    color: var(--tc-accent);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* ===== BUTTONS ===== */
.btn-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--tc-accent), var(--tc-accent-hover));
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 15px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--tc-accent-light);
}

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

.btn-text {
    color: white;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 1px;
}

.btn-verify {
    background: linear-gradient(135deg, var(--tc-success), #229954) !important;
}

.btn-resend {
    background: none;
    border: none;
    color: var(--tc-accent);
    cursor: pointer;
    transition: all 150ms;
    font-weight: 600;
    margin: 10px auto;
    display: block;
}

.btn-resend:hover {
    transform: scale(1.05);
    text-decoration: underline;
}

/* ===== PROGRESS BAR (REGISTRAZIONE) ===== */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    height: 6px;
    background: var(--tc-bg-primary);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tc-accent), var(--tc-warning));
    width: 33.33%;
    transition: width 500ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-glow {
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: progress-shine 2s linear infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-50px); }
    100% { transform: translateX(200px); }
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.step {
    text-align: center;
    opacity: 0.5;
    transition: all var(--transition);
}

.step.active {
    opacity: 1;
}

.step-circle {
    position: relative;
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
}

.step-number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tc-bg-tertiary);
    border: 2px solid var(--tc-border);
    border-radius: 50%;
    color: var(--tc-text-secondary);
    font-weight: 700;
    z-index: 2;
}

.step.active .step-number {
    background: var(--tc-accent);
    border-color: var(--tc-accent);
    color: var(--tc-text-primary);
    box-shadow: 0 0 20px var(--tc-accent-glow);
}

.step-pulse {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid var(--tc-accent);
    opacity: 0;
}

.step.active .step-pulse {
    animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.step-label {
    font-size: 0.75rem;
    color: var(--tc-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.step.active .step-label {
    color: var(--tc-accent);
}

/* ===== FORM STEPS ===== */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeInStep 0.5s ease-out;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-content {
    /* Container step */
}

.step-header {
    text-align: center;
    margin-bottom: 30px;
}

.step-title {
    font-size: 1.75rem;
    color: var(--tc-text-heading);
    margin-bottom: 5px;
}

.step-subtitle {
    color: var(--tc-text-secondary);
    font-size: 0.9rem;
}

/* ===== OTP SECTION ===== */
.otp-section {
    display: none;
    margin-top: 30px;
}

.otp-section.show {
    display: block;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.otp-digit {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--tc-bg-primary);
    border: 2px solid var(--tc-border);
    border-radius: 10px;
    color: var(--tc-text-primary);
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.otp-digit:focus {
    outline: none;
    border-color: var(--tc-accent);
    background: var(--tc-bg-tertiary);
    box-shadow: 0 0 15px var(--tc-accent-light);
    transform: scale(1.1);
}

.otp-digit.filled {
    border-color: var(--tc-success);
    animation: digit-pop 0.3s ease-out;
}

@keyframes digit-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.otp-separator {
    color: var(--tc-accent);
    font-size: 1.5rem;
    font-weight: 700;
}

.otp-timer {
    text-align: center;
    margin-bottom: 20px;
    color: var(--tc-text-secondary);
    font-size: 0.9rem;
}

.otp-timer span:last-child {
    color: var(--tc-accent);
    font-weight: 700;
    font-size: 1rem;
}

/* ===== COMUNI CHIPS ===== */
.comuni-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.chip {
    padding: 8px 16px;
    background: var(--tc-bg-tertiary);
    border: 1px solid var(--tc-border);
    border-radius: 20px;
    color: var(--tc-text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 150ms;
}

.chip:hover {
    background: var(--tc-accent);
    color: var(--tc-text-primary);
    border-color: var(--tc-accent);
    transform: scale(1.05);
    box-shadow: 0 5px 15px var(--tc-accent-light);
}

/* ===== AUTOCOMPLETE SUGGESTIONS ===== */
.comune-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--tc-bg-secondary);
    border: 2px solid var(--tc-accent);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 10px 30px var(--tc-shadow);
}

.comune-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 150ms;
    border-bottom: 1px solid var(--tc-border);
    color: var(--tc-text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
    background: var(--tc-accent);
    color: var(--tc-text-primary);
}

.suggestion-item small {
    color: var(--tc-text-secondary);
    font-size: 0.75rem;
    opacity: 0.7;
}

.suggestion-item:hover small,
.suggestion-item.highlighted small {
    color: var(--tc-text-primary);
    opacity: 0.8;
}

/* ===== FOOTER LINKS ===== */
.auth-footer {
    text-align: center;
    margin-top: 25px;
    color: var(--tc-text-secondary);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--tc-accent);
    text-decoration: none;
    font-weight: 600;
}

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

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--tc-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s;
}

.back-link:hover {
    color: var(--tc-accent);
}

/* ===== DIVIDER ===== */
.divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    color: var(--tc-text-secondary);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--tc-border);
}

.divider::before {
    margin-right: 1rem;
}

.divider::after {
    margin-left: 1rem;
}

/* ===== FORM ROW ===== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ===== ALERT MESSAGES ===== */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(192, 57, 43, 0.1);
    border: 1px solid var(--tc-error);
    color: var(--tc-error);
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid var(--tc-success);
    color: var(--tc-success);
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid #3498DB;
    color: #3498DB;
}

/* ===== SUCCESS STATE ===== */
.success-state {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    margin: 0 auto 25px;
}

.circle-anim {
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    animation: drawCircle 0.6s ease-out forwards;
}

.check-anim {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.4s ease-out 0.6s forwards;
}

@keyframes drawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.success-state h2 {
    font-size: 1.75rem;
    margin-bottom: 10px;
}

.success-state p {
    color: var(--tc-text-secondary);
    margin-bottom: 25px;
}

.redirect-loader {
    width: 200px;
    margin: 0 auto;
    height: 4px;
    background: var(--tc-bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.loader-bar {
    height: 100%;
    background: var(--tc-success);
    animation: loading 2.5s linear forwards;
}

@keyframes loading {
    from { width: 0; }
    to { width: 100%; }
}

/* ===== LOADING SPINNER ===== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== NOTIFICATION STYLES ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    z-index: 9999;
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 300px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: linear-gradient(135deg, #27AE60, #229954);
    color: white;
}

.notification-error {
    background: linear-gradient(135deg, #C0392B, #A93226);
    color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .auth-card,
    .registration-card {
        padding: 30px 20px;
    }
    
    .logo-title {
        font-size: 2rem;
        gap: 10px;
    }
    
    .logo-subtitle {
        font-size: 0.875rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .otp-digit {
        width: 45px;
        height: 55px;
        font-size: 1.3rem;
    }
    
    .comuni-chips {
        gap: 6px;
    }
    
    .chip {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    
    .step-circle {
        width: 35px;
        height: 35px;
    }
    
    .step-number {
        font-size: 0.85rem;
    }
    
    .step-label {
        font-size: 0.65rem;
    }
    
    .notification {
        left: 20px;
        right: 20px;
        min-width: auto;
    }
}