/* =============================================================
   AUTH CSS – Login, Registrazione, Recupero password
   Layout: pannello visivo sinistro + form destro
============================================================= */

/* --- LAYOUT PAGINA --- */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* --- PANNELLO VISIVO (sinistra) --- */
.auth-visual {
    position: relative;
    overflow: hidden;
    background: var(--color-bg-2);
    border-right: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
}

.auth-visual-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(124,58,237,0.25) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(167,139,250,0.15) 0%, transparent 50%);
    pointer-events: none;
}

.auth-visual-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
}

.auth-visual-orb-1 {
    width: 400px; height: 400px;
    background: rgba(124,58,237,0.2);
    top: -100px; left: -100px;
    animation: orb-float 9s ease-in-out infinite;
}

.auth-visual-orb-2 {
    width: 300px; height: 300px;
    background: rgba(167,139,250,0.15);
    bottom: -80px; right: -80px;
    animation: orb-float 7s ease-in-out infinite reverse;
}

@keyframes orb-float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 36px;
    max-width: 380px;
    width: 100%;
}

.auth-logo-big {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -0.5px;
}

.auth-visual-text h2 {
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 12px;
}

.auth-visual-text p {
    font-size: 15px;
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* Mini player decorativo */
.auth-mini-player {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    backdrop-filter: blur(10px);
}

.amp-cover {
    width: 44px; height: 44px;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    flex-shrink: 0;
    animation: cover-shift 4s ease-in-out infinite;
}

@keyframes cover-shift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg) brightness(1.1); }
}

.amp-info { flex: 1; min-width: 0; }

.amp-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.amp-artist {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.amp-bar {
    height: 3px;
    background: var(--color-bg-3);
    border-radius: 2px;
    overflow: hidden;
}

.amp-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 2px;
    animation: amp-prog 5s linear infinite;
}

@keyframes amp-prog { 0% { width: 0%; } 100% { width: 100%; } }

.amp-icon { font-size: 20px; flex-shrink: 0; }

/* Features mini */
.auth-visual-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avf-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.avf-item span {
    color: var(--color-success);
    font-weight: 700;
    font-size: 15px;
}

/* --- PANNELLO FORM (destra) --- */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--color-bg);
    overflow-y: auto;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-card-header {
    margin-bottom: 32px;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-muted);
    transition: color 0.2s;
}

.auth-back-link:hover { color: var(--color-text); }

.auth-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 32px;
    line-height: 1.5;
}

/* --- FORM --- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group { margin-bottom: 16px; }

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.forgot-link {
    font-size: 12px;
    color: var(--color-accent);
    font-weight: 500;
    transition: color 0.2s;
}
.forgot-link:hover { color: var(--color-text); }

/* Input con icona */
.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--color-text-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.input-with-icon {
    padding-left: 42px !important;
}

/* Input password con icona + toggle */
.input-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-password-wrap .form-input {
    padding-left: 42px;
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.toggle-password:hover { color: var(--color-text); }

/* Input base override per auth */
.auth-form .form-input {
    height: 48px;
    font-size: 14px;
    background: var(--color-bg-2);
    border: 1.5px solid var(--color-border);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form .form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
    outline: none;
}

.auth-form .form-input.error {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.form-error {
    display: block;
    font-size: 12px;
    color: var(--color-danger);
    margin-top: 5px;
    min-height: 16px;
}

/* Checkbox Ricordami */
.form-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text-muted);
    cursor: pointer;
    user-select: none;
}

.form-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* Alert errore globale */
.form-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: var(--radius-md);
    color: var(--color-danger);
    font-size: 13px;
    margin-bottom: 4px;
}

.form-alert::before { content: '⚠️'; font-size: 14px; }

/* Alert successo */
.form-alert-success {
    background: rgba(16,185,129,0.08);
    border-color: rgba(16,185,129,0.25);
    color: var(--color-success);
}
.form-alert-success::before { content: '✅'; }

/* Bottone submit */
.btn-submit {
    height: 48px;
    font-size: 15px;
    justify-content: center;
    margin-top: 8px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(124,58,237,0.3);
    transition: all 0.2s ease;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(124,58,237,0.45);
}

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

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--color-text-muted);
    font-size: 12px;
}

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

/* Footer testo */
.auth-footer-text {
    text-align: center;
    font-size: 14px;
    color: var(--color-text-muted);
}

.auth-footer-text a {
    color: var(--color-accent);
    font-weight: 600;
    transition: color 0.2s;
}

.auth-footer-text a:hover { color: var(--color-text); }

/* Password strength bar (per register) */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: var(--color-bg-3);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0%;
}

.strength-fill.weak   { width: 25%; background: var(--color-danger); }
.strength-fill.fair   { width: 50%; background: var(--color-warning); }
.strength-fill.good   { width: 75%; background: #3b82f6; }
.strength-fill.strong { width: 100%; background: var(--color-success); }

.strength-label {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* Modal successo registrazione */
.success-modal-icon { font-size: 56px; text-align: center; margin-bottom: 16px; }
.success-modal-title { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 8px; }
.success-modal-body {
    text-align: center;
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 24px;
}
.success-modal-body strong { color: var(--color-text); }
.success-modal-body .warning-note {
    margin-top: 16px;
    padding: 12px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: var(--radius-md);
    color: var(--color-warning);
    font-size: 13px;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-panel { min-height: 100vh; padding: 40px 20px; }
}

@media (max-width: 480px) {
    .auth-card { max-width: 100%; }
    .auth-title { font-size: 24px; }
}

/* --- AUTH STEPS (register) --- */
.auth-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.auth-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    opacity: 0.45;
}

.auth-step.auth-step-active { opacity: 1; }

.auth-step-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--color-bg-3);
    border: 1.5px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.auth-step.auth-step-active .auth-step-num {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.auth-step-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.auth-step-desc {
    font-size: 12px;
    color: var(--color-text-muted);
}

.auth-step-line {
    width: 1.5px;
    height: 20px;
    background: var(--color-border);
    margin-left: 15px;
}
