*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    padding: 2.5rem 0;
    text-align: center;
}

.site-header h1 {
    font-size: 2rem;
    font-weight: 700;
}

.site-header p {
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* Cards */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    margin: 1.5rem 0;
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.form-section-header h2 {
    margin-bottom: 0;
}

.is-hidden {
    display: none;
}

.toolbar {
    margin: 1.5rem 0 0;
    text-align: right;
}

.badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

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

.alert-warning {
    background: #fffbeb;
    color: var(--warning);
    border: 1px solid #fde68a;
}

/* Form */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-group.field-error input,
.form-group.field-error select,
.form-group.field-error textarea {
    border-color: var(--danger);
}

.error-msg {
    display: block;
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.hint {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.phone-input {
    display: flex;
    align-items: stretch;
}

.phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-right: 0;
    border-radius: 8px 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.phone-input input {
    border-radius: 0 8px 8px 0;
    flex: 1;
}

.form-group.field-error .phone-prefix {
    border-color: var(--danger);
}

.form-actions {
    margin-top: 1.25rem;
    text-align: right;
}

.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
}

.media-section {
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-label {
    font-size: 0.875rem;
    font-weight: 600;
}

.section-hint {
    margin-top: 0.25rem;
}

/* Pet Grid */
.pet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.pet-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.pet-card:hover {
    box-shadow: var(--shadow);
}

.pet-media {
    background: #000;
}

.pet-photo img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.embed-wrap {
    position: relative;
    width: 100%;
    background: #000;
}

.embed-youtube,
.embed-tiktok {
    aspect-ratio: 16 / 9;
}

.embed-instagram {
    min-height: 480px;
}

.embed-frame {
    width: 100%;
    height: 100%;
    min-height: 200px;
    border: 0;
    display: block;
}

.embed-instagram .embed-frame {
    min-height: 480px;
}

.no-photo {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: var(--muted);
    font-size: 0.9rem;
}

.pet-info {
    padding: 1rem;
}

.pet-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.pet-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.tag {
    display: inline-block;
    background: #eef2ff;
    color: var(--primary);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.25rem;
}

.tag-embed {
    background: #fef3c7;
    color: #b45309;
}

.pet-desc {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pet-owner {
    font-size: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.pet-owner strong {
    display: block;
    margin-bottom: 0.5rem;
}

.btn-wa {
    display: inline-block;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.btn-wa:hover {
    background: #128c7e;
    color: #fff;
}

.pet-date {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 2rem 0;
}

/* Responsive */
@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .site-header h1 {
        font-size: 1.5rem;
    }
}
