/* --- ESTILOS CRÍTICOS (Login y Botones) --- */
* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #eef2f6; margin: 0; padding: 20px; color: #334155; }

/* Forzamos el botón principal al inicio del archivo para evitar errores de lectura */
button.btn-primary, .btn-primary {
    background-color: #4f46e5 !important;
    color: white !important;
    border: none !important;
    padding: 14px 20px !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    width: 100% !important;
    display: block !important;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
button.btn-primary:active { transform: scale(0.98); }

/* Login Card Rediseñada */
.container { max-width: 500px; margin: 0 auto; }
.login-card {
    background: white;
    padding: 40px 30px;
    border-radius: 24px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    text-align: center;
    margin-top: 60px;
}
.logo-area { font-size: 50px; margin-bottom: 10px; }
.login-card h1 { margin: 10px 0 5px; color: #1e293b; }

.input-wrapper { margin-bottom: 15px; }
.input-wrapper input, input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    background: #f8fafc;
    transition: border-color 0.2s;
    outline: none;
}
.input-wrapper input:focus { border-color: #4f46e5; background: white; }

/* Fix Autocomplete Azul Chrome */
input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px white inset !important; }

/* --- RESTO DE LA APP --- */
.hidden { display: none !important; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; padding-bottom: 100px; }
.card { background: white; padding: 20px; border-radius: 16px; text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.05); cursor: pointer; transition: transform 0.2s; }
.card:active { transform: scale(0.95); }

.avatar { width: 80px; height: 80px; border-radius: 50%; background: #e2e8f0; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 30px; object-fit: cover; }

/* FAB */
.fab { position: fixed; bottom: 25px; right: 25px; width: 65px; height: 65px; background: #4f46e5; color: white; border: none; border-radius: 50%; font-size: 35px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3); z-index: 99; }

/* Detalle */
.profile-header { text-align: center; margin-bottom: 25px; }
.avatar-large { width: 140px; height: 140px; margin: 0 auto 15px; position: relative; }
.avatar-large img, #pet-avatar-placeholder { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #cbd5e1; display: flex; align-items: center; justify-content: center; font-size: 50px; border: 4px solid white; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.badge-edit { position: absolute; bottom: 5px; right: 5px; background: #0f172a; color: white; padding: 6px 10px; border-radius: 20px; font-size: 14px; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

.actions-bar { display: flex; justify-content: center; gap: 12px; margin-bottom: 25px; }
.qr-section { display: flex; justify-content: center; background: white; padding: 20px; border-radius: 16px; margin-bottom: 25px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }

.form-grid { background: white; padding: 25px; border-radius: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.full-width { grid-column: 1 / -1; }
.input-group label { display: block; font-size: 13px; color: #64748b; margin-bottom: 6px; font-weight: 700; text-transform: uppercase; }
.input-group input:disabled { border: none; background: transparent; padding: 0; font-weight: 600; font-size: 17px; color: #1e293b; }

.action-footer { position: fixed; bottom: 0; left: 0; width: 100%; background: white; padding: 20px; display: flex; gap: 15px; box-shadow: 0 -4px 20px rgba(0,0,0,0.1); z-index: 100; }
.action-footer button { flex: 1; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 15px; }
.gallery-item { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.btn-delete-img { position: absolute; top: 4px; right: 4px; background: rgba(220, 38, 38, 0.9); color: white; border: none; border-radius: 50%; width: 24px; height: 24px; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Botones Secundarios */
.btn-secondary { background: #f1f5f9; color: #475569; border: none; padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; transition: background 0.2s; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #fee2e2; color: #ef4444; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.btn-text { background: none; border: none; color: #64748b; font-weight: 600; cursor: pointer; margin-bottom: 15px; font-size: 15px; }

/* Vista Pública */
.public-view { max-width: 450px; margin: 30px auto; background: white; padding: 40px 30px; border-radius: 24px; box-shadow: 0 10px 40px rgba(0,0,0,0.1); text-align: center; }
.chip-badge { display: inline-block; background: #e0e7ff; color: #4338ca; padding: 6px 16px; border-radius: 99px; font-size: 14px; font-weight: 800; letter-spacing: 0.5px; }
.alert-box { margin-top: 30px; background: #fef2f2; padding: 25px; border-radius: 16px; border: 2px solid #fee2e2; }
.btn-call { display: block; background: #22c55e; color: white; text-decoration: none; padding: 16px; border-radius: 12px; font-weight: 700; font-size: 18px; margin-top: 15px; box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3); }
.btn-call.secondary { background: #0ea5e9; box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3); }

/* Modales */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px); }
.modal-content { background: white; padding: 30px; border-radius: 20px; width: 90%; max-width: 400px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.modal-actions { display: flex; justify-content: flex-end; gap: 15px; margin-top: 25px; }