/* ============================================================================
   AUTH.CSS - Design Moderno & Armonizzato per l'Autenticazione Price Tracker
   ============================================================================ */

/* Header compatto per pagine di autenticazione */
header.top.top-auth {
    padding: 0.35rem 0.75rem !important;
    min-height: 42px !important;
}
header.top.top-auth .top-logo img {
    height: 30px !important;
    width: auto !important;
}
header.top.top-auth .top-brand {
    margin: 0 !important;
}

/* Contenitore compatto a schermo intero con sfondo moderno ad ambient glow */
.auth-container {
    min-height: calc(100vh - 44px);
    display: flex;
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.16) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(14, 165, 233, 0.14) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(30, 41, 59, 0.6) 0%, transparent 100%),
        linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    padding: 0.5rem 0.75rem;
    box-sizing: border-box;
}

/* Card di autenticazione moderna ultra-compatta */
.auth-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 
        0 12px 35px -8px rgba(15, 23, 42, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 370px;
    padding: 0.85rem 1.1rem;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    animation: authCardEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardEnter {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Barra decorativa superiore della card */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981 0%, #06b6d4 50%, #3b82f6 100%);
}

/* Header brand interno alla card */
.auth-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.2), 0 0 0 1px #e2e8f0;
    margin: 0 auto 0.4rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.25s ease;
}

.auth-brand-badge:hover {
    transform: translateY(-2px) scale(1.03);
}

.auth-brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.1rem 0;
    letter-spacing: -0.2px;
    line-height: 1.2;
}

.auth-subtitle {
    font-size: 0.76rem;
    color: #64748b;
    margin: 0;
    line-height: 1.3;
}

/* Selettore versione compatto (Stabile / Beta) */
.version-selector-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f1f5f9;
    padding: 2px 4px;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid #e2e8f0;
}

.version-sel-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding-left: 4px;
}

.version-sel-group {
    display: flex;
    gap: 3px;
}

.btn-ver {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-ver.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-weight: 700;
}

.btn-ver-beta.active {
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 1px 6px rgba(245, 158, 11, 0.3);
    font-weight: 700;
}

/* Avviso modalità BETA */
.alert-beta-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 0.5rem;
    align-items: flex-start;
    gap: 8px;
    color: #92400e;
    font-size: 0.78rem;
    line-height: 1.35;
    animation: fadeIn 0.2s ease;
}

.alert-beta-warning strong {
    color: #78350f;
    font-size: 0.82rem;
}

.beta-warning-icon {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

/* Form e controlli di input ultra-compatti */
.auth-form {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.2rem;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.76rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.2rem;
}

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-left {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.input-icon-left svg {
    width: 16px;
    height: 16px;
}

.form-group input {
    width: 100%;
    padding: 0.4rem 0.65rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #0f172a;
    background: #f8fafc;
    transition: all 0.18s ease;
    box-sizing: border-box;
    height: 36px;
    font-family: inherit;
}

.form-group input.has-icon-left {
    padding-left: 32px !important;
}

.form-group input.has-icon-right {
    padding-right: 34px !important;
}

.form-group input:focus {
    border-color: #10b981;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    outline: none;
}

.form-group input::placeholder {
    color: #94a3b8;
    font-size: 0.82rem;
}

/* Pulsante mostra/nascondi password */
.toggle-pwd-btn {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    user-select: none;
}

.toggle-pwd-btn svg {
    width: 16px;
    height: 16px;
}

.toggle-pwd-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.toggle-pwd-btn:focus {
    outline: none;
    color: #10b981;
}

/* Pulsante principale di azione compatto */
.btn-primary.btn-block {
    width: 100%;
    padding: 0.48rem 0.9rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.2px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-sizing: border-box;
    text-decoration: none;
    height: 36px;
}

.btn-primary.btn-block:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.btn-primary.btn-block:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(16, 185, 129, 0.2);
}

/* Pulsante secondario */
.btn-secondary {
    width: 100%;
    padding: 0.45rem 0.85rem;
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-decoration: none;
    height: 36px;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
}

/* Separatore social compatto */
.social-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 0.45rem 0 0.4rem;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 500;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.social-divider span {
    padding: 0 0.6rem;
    background: #ffffff;
}

/* Griglia social login compatta */
.social-login-grid {
    display: grid;
    gap: 0.4rem;
}

.btn-social-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.42rem 0.85rem;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    height: 36px;
    transition: all 0.18s ease;
}

.btn-social-oauth svg {
    width: 16px;
    height: 16px;
}

.btn-social-google {
    background: #ffffff;
    color: #1e293b;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-social-google:hover {
    background: #f8fafc;
    border-color: #cbd5e1 !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
    color: #0f172a;
}

.btn-social-google:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Link di navigazione auth in calce alla card compatti */
.auth-footer {
    margin: 0.4rem 0 0 0;
    text-align: center;
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.3;
}

.auth-footer a {
    color: #059669;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

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

/* Notifiche e Alert (Errori, Info, Successo) compatti */
.alert {
    border-radius: 8px;
    padding: 0.4rem 0.65rem;
    font-size: 0.78rem;
    line-height: 1.35;
    margin-bottom: 0.45rem;
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    box-sizing: border-box;
}

.alert svg {
    width: 16px;
    height: 16px;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

/* Footer versione generale in auth-container compatto */
.auth-container .page-footer {
    color: rgba(255, 255, 255, 0.55) !important;
    padding: 0.35rem 0.5rem 0.15rem !important;
    font-size: 0.7rem;
    text-align: center;
    width: 100%;
}

.auth-container .page-footer .version {
    color: #34d399 !important;
    background: rgba(16, 185, 129, 0.18);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Ottimizzazioni Mobile Ultra-Compatte (nessuno scroll necessario) */
@media (max-width: 480px) {
    .auth-container {
        padding: 0.35rem 0.6rem;
        justify-content: center;
        padding-top: 0.35rem;
    }
    .auth-card {
        padding: 0.75rem 0.95rem;
        border-radius: 12px;
        max-width: 100%;
    }
    .auth-title {
        font-size: 1.08rem;
    }
    .auth-subtitle {
        font-size: 0.74rem;
    }
    .form-group input {
        height: 35px;
        font-size: 0.85rem;
    }
    .btn-primary.btn-block,
    .btn-social-oauth {
        height: 35px;
        font-size: 0.85rem;
    }
}
