/* =============================================
   AUTH PAGE — ProntoQR
   ============================================= */

.auth-body {
    min-height: 100vh;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
}

/* HEADER MINIMAL */
.auth-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
}

.auth-nav {
    max-width: 1100px;
    margin: 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-back-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* MAIN */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

/* CARD */
.auth-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

/* TOGGLE */
.auth-toggle {
    display: flex;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 2rem;
    gap: 4px;
}

.auth-toggle-btn {
    flex: 1;
    padding: 0.55rem 1rem;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.auth-toggle-btn.active {
    background: #ffffff;
    color: var(--brand-darkblue);
    box-shadow: var(--shadow-sm);
}

/* TITOLI */
.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand-darkblue);
    margin-bottom: 0.3rem;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.8rem;
}

/* CAMPI */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.auth-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
}

.auth-field input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-medium);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-main);
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.auth-field input::placeholder {
    color: #cbd5e1;
}

/* PASSWORD WRAPPER */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 2.8rem;
}

.toggle-password {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

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

/* MESSAGGI */
.auth-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 0.85rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--border-radius-medium);
    margin-bottom: 1rem;
}

.auth-success {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    font-size: 0.85rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--border-radius-medium);
    margin-bottom: 1rem;
}

/* SUBMIT */
.auth-submit-btn {
    width: 100%;
    padding: 0.85rem;
    background: var(--brand-green);
    color: #ffffff;
    border: none;
    border-radius: var(--border-radius-medium);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    margin-top: 0.5rem;
    margin-bottom: 1.2rem;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.auth-submit-btn:hover {
    background: var(--brand-green-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

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

/* SPINNER */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 0.8s linear infinite;
}

/* TESTI SOTTO FORM */
.auth-switch-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.8rem;
}

.auth-link-btn {
    background: none;
    border: none;
    color: var(--brand-purple);
    font-weight: 600;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
    text-decoration: underline;
}

.auth-legal {
    text-align: center;
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}

.auth-legal a {
    color: var(--text-muted);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.2rem;
        border-radius: 16px;
    }
}
