/* ============================================
   DogTag NFC – Frontend Styles
   ============================================ */

:root {
    --dt-brand:      #0d6efd;
    --dt-brand-dark: #0a58ca;
    --dt-accent:     #fd7e14;
    --dt-surface:    #f8f9fa;
    --dt-radius:     1rem;
}

/* ── Wrapper app ────────────────────────────── */
.dogtag-app {
    font-family: 'Segoe UI', system-ui, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

/* ── Pagina pubblica hero ───────────────────── */
.dt-hero {
    background: linear-gradient(135deg, var(--dt-brand) 0%, #6610f2 100%);
    color: #fff;
    border-radius: 0 0 2rem 2rem;
    padding: 3rem 1.5rem 4rem;
    text-align: center;
    margin: 0 -1rem 2rem;
}
.dt-hero h1 { font-size: 1.8rem; font-weight: 800; }
.dt-hero p  { opacity: .8; }

/* ── Avatar cane ────────────────────────────── */
.dt-avatar {
    width: 130px; height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    margin: 0 auto 1rem;
    display: block;
}
.dt-avatar-placeholder {
    width: 130px; height: 130px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 3.5rem;
    margin: 0 auto 1rem;
    border: 4px solid rgba(255,255,255,.4);
}

/* ── Card generica ──────────────────────────── */
.dt-card {
    background: #fff;
    border-radius: var(--dt-radius);
    box-shadow: 0 2px 16px rgba(0,0,0,.07);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(0,0,0,.06);
    transition: box-shadow .2s;
}
.dt-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.12); }

/* ── Badge stato ────────────────────────────── */
.dt-badge {
    display: inline-block;
    padding: .35em .8em;
    border-radius: 2em;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.dt-badge-attivo   { background: #d1fae5; color: #065f46; }
.dt-badge-smarrito { background: #fee2e2; color: #991b1b; animation: dt-pulse 1.2s infinite; }
.dt-badge-new      { background: #e0e7ff; color: #3730a3; }

@keyframes dt-pulse {
    0%,100% { opacity: 1; }
    50%      { opacity: .6; }
}

/* ── Bottoni ────────────────────────────────── */
.dt-btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .6rem 1.4rem;
    border-radius: .6rem;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: background .15s, transform .1s, box-shadow .15s;
}
.dt-btn:active { transform: scale(.97); }
.dt-btn-primary {
    background: var(--dt-brand);
    color: #fff;
    border-color: var(--dt-brand);
}
.dt-btn-primary:hover {
    background: var(--dt-brand-dark);
    border-color: var(--dt-brand-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(13,110,253,.35);
}
.dt-btn-outline {
    background: transparent;
    color: var(--dt-brand);
    border-color: var(--dt-brand);
}
.dt-btn-outline:hover {
    background: var(--dt-brand);
    color: #fff;
}
.dt-btn-danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}
.dt-btn-warning {
    background: var(--dt-accent);
    color: #fff;
    border-color: var(--dt-accent);
}
.dt-btn-block { display: flex; width: 100%; justify-content: center; }
.dt-btn-sm { padding: .4rem .9rem; font-size: .85rem; }

/* ── Modulo / form ──────────────────────────── */
.dt-form-group { margin-bottom: 1.1rem; }
.dt-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: .4rem;
    font-size: .9rem;
}
.dt-form-group input:not([type="radio"]):not([type="checkbox"]),
.dt-form-group textarea,
.dt-form-group select {
    width: 100%;
    padding: .65rem .9rem;
    border: 1.5px solid #dee2e6;
    border-radius: .6rem;
    font-size: 1rem;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
}
.dt-form-group input[type="radio"],
.dt-form-group input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}
.dt-form-group input:not([type="radio"]):not([type="checkbox"]):focus,
.dt-form-group textarea:focus {
    outline: none;
    border-color: var(--dt-brand);
    box-shadow: 0 0 0 3px rgba(13,110,253,.12);
}
.dt-form-help { font-size: .8rem; color: #6c757d; margin-top: .25rem; }

/* ── Alert ──────────────────────────────────── */
.dt-alert {
    padding: .85rem 1.1rem;
    border-radius: .6rem;
    margin-bottom: 1rem;
    font-size: .9rem;
}
.dt-alert-danger  { background: #fee2e2; color: #991b1b; border-left: 4px solid #dc3545; }
.dt-alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.dt-alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }

/* ── Dashboard grid tag ─────────────────────── */
.dt-tag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}
.dt-tag-card-img {
    width: 52px; height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #dee2e6;
    flex-shrink: 0;
}
.dt-tag-card-placeholder {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}
.dt-stat-box {
    background: var(--dt-surface);
    border-radius: .5rem;
    padding: .6rem .8rem;
    text-align: center;
    flex: 1;
}
.dt-stat-box .dt-stat-val { font-weight: 800; color: var(--dt-brand); font-size: 1.1rem; }
.dt-stat-box .dt-stat-lbl { font-size: .75rem; color: #6c757d; }

/* ── Upload foto preview ────────────────────── */
#dt-foto-preview {
    width: 110px; height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--dt-brand);
    display: none;
    margin: 0 auto .75rem;
}
.dt-avatar-upload {
    text-align: center;
    margin-bottom: 1.5rem;
}
.dt-avatar-upload-placeholder {
    width: 110px; height: 110px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
    color: #94a3b8;
    margin: 0 auto .75rem;
    border: 2px dashed #cbd5e1;
}

/* ── Table scansioni ────────────────────────── */
.dt-table { width: 100%; border-collapse: collapse; }
.dt-table th {
    text-align: left;
    padding: .6rem .8rem;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
}
.dt-table td {
    padding: .75rem .8rem;
    font-size: .875rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.dt-table tr:last-child td { border-bottom: none; }
.dt-table tr:hover td { background: #f8f9fa; }

/* ── Paginazione ────────────────────────────── */
.dt-pagination { display: flex; gap: .35rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.dt-pagination a, .dt-pagination span {
    padding: .4rem .75rem;
    border-radius: .4rem;
    font-size: .85rem;
    border: 1.5px solid #dee2e6;
    text-decoration: none;
    color: var(--dt-brand);
}
.dt-pagination .current { background: var(--dt-brand); color: #fff; border-color: var(--dt-brand); }

/* ── Header sezione ─────────────────────────── */
.dt-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.dt-section-header h2 { margin: 0; font-size: 1.3rem; font-weight: 800; }

/* ── Empty state ────────────────────────────── */
.dt-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}
.dt-empty .dt-empty-icon { font-size: 4rem; margin-bottom: .75rem; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 600px) {
    .dt-hero { padding: 2rem 1rem 3rem; border-radius: 0 0 1.5rem 1.5rem; }
    .dt-hero h1 { font-size: 1.5rem; }
    .dt-table th:nth-child(4),
    .dt-table td:nth-child(4) { display: none; }
}

/* ============================================
   BANNER "Hai trovato un cane?" – Homepage
   ============================================ */

.dt-found-banner {
    background: linear-gradient(135deg, #FFF7ED 0%, #FFFBEB 100%);
    border: 2px solid var(--dt-accent);
    border-radius: var(--dt-radius);
    padding: 1.5rem;
    margin: 0 0 2.5rem;
    box-shadow: 0 4px 20px rgba(245,158,11,.15);
}

.dt-found-banner-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.dt-found-banner-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    animation: dt-wag .8s ease-in-out infinite alternate;
}

@keyframes dt-wag {
    from { transform: rotate(-8deg); }
    to   { transform: rotate(8deg); }
}

.dt-found-banner-text {
    flex: 1;
    min-width: 200px;
}

.dt-found-banner-text strong {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--dt-primary);
    margin-bottom: .2rem;
}

.dt-found-banner-text span {
    font-size: .9rem;
    color: var(--dt-text-muted);
}

/* ============================================
   PAGINA "Trova il cane" – find-dog.php
   ============================================ */

.dt-find-page {
    max-width: 500px;
    margin: 0 auto;
    padding: 1rem 0 3rem;
}

.dt-find-header {
    text-align: center;
    margin-bottom: 2rem;
}

.dt-find-header-icon {
    font-size: 4rem;
    margin-bottom: .75rem;
    display: block;
    animation: dt-bounce .6s ease-in-out infinite alternate;
}

@keyframes dt-bounce {
    from { transform: translateY(0); }
    to   { transform: translateY(-8px); }
}

.dt-find-header h1 {
    font-size: clamp(1.6rem, 5vw, 2rem);
    font-weight: 800;
    color: var(--dt-primary);
    letter-spacing: -.02em;
    margin-bottom: .5rem;
}

.dt-find-header p {
    color: var(--dt-text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.dt-find-card {
    padding: 2rem;
}

/* Steps istruzione */
.dt-find-instruction {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.dt-find-instruction-step {
    display: flex;
    align-items: center;
    gap: .85rem;
    font-size: .9rem;
    color: var(--dt-text);
}

.dt-find-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--dt-primary);
    color: #fff;
    font-weight: 800;
    font-size: .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Input codice grande */
.dt-find-input {
    width: 100%;
    text-align: center;
    font-size: 2rem !important;
    font-weight: 800 !important;
    letter-spacing: .25em !important;
    text-transform: uppercase;
    padding: 1rem !important;
    border: 2.5px solid var(--dt-border) !important;
    border-radius: var(--dt-radius) !important;
    transition: border-color .15s, box-shadow .15s;
    font-family: 'Courier New', monospace !important;
    color: var(--dt-primary) !important;
    background: var(--dt-surface) !important;
    margin-top: .5rem;
}

.dt-find-input:focus {
    border-color: var(--dt-accent) !important;
    box-shadow: 0 0 0 4px rgba(245,158,11,.15) !important;
    outline: none;
    background: #fff !important;
}

.dt-find-input::placeholder {
    color: #D1D5DB !important;
    letter-spacing: .2em;
}

/* Tip NFC in fondo */
.dt-find-nfc-tip {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    background: var(--dt-surface-2);
    border-radius: var(--dt-radius-sm);
    padding: 1rem 1.1rem;
    margin-top: 1.25rem;
    font-size: .85rem;
    color: var(--dt-text-muted);
    line-height: 1.5;
}

.dt-find-nfc-tip span:first-child {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: -.1rem;
}

/* Responsive banner */
@media (max-width: 600px) {
    .dt-found-banner-inner {
        flex-direction: column;
        text-align: center;
    }
    .dt-found-banner-inner .dt-btn {
        width: 100%;
        justify-content: center;
    }
    .dt-find-card { padding: 1.25rem; }
    .dt-find-input { font-size: 1.6rem !important; }
}
