/* =========================
   CONTENEDOR GENERAL
========================= */
.petbuddy-auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 20px;
    font-family: system-ui, -apple-system, sans-serif;
}

/* =========================
   TARJETA DEL FORMULARIO
========================= */
.petbuddy-auth-card {
    background-color: rgba(255,255,255,0.98);
    border-radius: 18px;
    padding: 30px 25px 35px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
}

/* =========================
   TÍTULO Y TEXTO
========================= */
.pb-title {
    color: #4a90e2;
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.pb-text {
    font-size: 1rem;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* =========================
   AVATAR (Registro y Verificación)
========================= */
.petbuddy-avatar,
.pb-avatar {
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f0f4f8;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.petbuddy-avatar img,
.pb-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================
   INPUTS Y SELECTS
========================= */
.petbuddy-auth-card input:not(.pb-code),
.petbuddy-auth-card select {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 14px;
    transition: border-color 0.3s;
}

.petbuddy-auth-card input:focus {
    border-color: #4a90e2;
    outline: none;
}

/* INPUTS DE CÓDIGO (6 DÍGITOS) */
.pb-code {
    width: 45px;
    height: 55px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin: 0 2px;
    transition: all 0.3s;
}

.pb-code:focus {
    border-color: #4a90e2;
    background-color: #f9fbff;
    outline: none;
}

.pb-error-input {
    border-color: #d32f2f !important;
    background-color: #fff8f8;
}

/* =========================
   MENSAJE DE ERROR (BLINDADO)
========================= */
.pb-error-verify, 
#register-message {
    color: #d32f2f;
    font-weight: 600;
    margin-bottom: 15px;
    padding: 12px;
    background-color: #ffebee;
    border-radius: 10px;
    font-size: 14px;
    display: none;
    border: 1px solid #ffcdd2;
    animation: fadeIn 0.3s ease;
}

/* =========================
   BOTONES
========================= */
.petbuddy-btn {
    width: 100%;
    padding: 14px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.petbuddy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.petbuddy-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

#resend-btn {
    background: none;
    border: none;
    color: #4a90e2;
    cursor: pointer;
    font-weight: bold;
    text-decoration: underline;
    transition: color 0.3s;
}

#resend-btn:hover {
    color: #2a5a8f;
}

#resend-btn:disabled {
    color: #999;
    text-decoration: none;
}

/* =========================
   ÉXITO Y LOADER
========================= */
.pb-success-box {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.pb-checkmark {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #4CAF50;
    color: white;
    font-size: 40px;
    line-height: 70px;
    font-weight: bold;
    animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pb-loader {
    width: 35px;
    height: 35px;
    margin: 20px auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* =========================
   ANIMACIONES
========================= */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.pb-shake { animation: shake 0.3s ease-in-out 2; }

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 480px) {
    .petbuddy-auth-card { padding: 25px 15px; }
    .pb-code { width: 38px; height: 48px; font-size: 1.2rem; }
}