* {
    box-sizing: border-box;
}

:root {
    --bg: #0f172a;
    --card: #111827;
    --card-2: #1f2937;
    --border: rgba(255,255,255,0.08);
    --text: #f8fafc;
    --muted: #94a3b8;
    --primary: #f59e0b;
    --primary-dark: #d97706;
    --danger: #ef4444;
    --success: #22c55e;
    --radius: 18px;
    --shadow: 0 20px 50px rgba(0,0,0,0.35);
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(245,158,11,0.08), transparent 18%),
        linear-gradient(135deg, #020617 0%, #0f172a 50%, #111827 100%);
    color: var(--text);
    min-height: 100vh;
}

.container {
    width: min(1280px, calc(100% - 32px));
    margin: 32px auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.brand h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -0.02em;
}

.brand p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

button,
.file-label {
    border: none;
    outline: none;
    cursor: pointer;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 14px;
    transition: 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover,
.file-label:hover {
    transform: translateY(-1px);
}

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

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

.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-danger {
    background: rgba(239,68,68,0.15);
    color: #fecaca;
    border: 1px solid rgba(239,68,68,0.35);
}

.grid {
    display: grid;
    grid-template-columns: 1.5fr 0.9fr;
    gap: 20px;
}

.card {
    background: rgba(17,24,39,0.84);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: 18px;
}

.card-header p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.card-body {
    padding: 20px;
}

.upload-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

input[type="file"] {
    display: none;
}

.editor-stage {
    position: relative;
    width: 100%;
    min-height: 500px;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border: 2px dashed rgba(255,255,255,0.12);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.editor-stage.empty::before {
    content: "Envie uma foto do look para começar";
    color: var(--muted);
    font-size: 16px;
    text-align: center;
    padding: 24px;
}

.editor-image {
    width: 100%;
    display: block;
    max-height: 75vh;
    object-fit: contain;
    pointer-events: none;
}

.hotspot {
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #111827;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 22px rgba(245,158,11,0.35);
    border: 3px solid rgba(255,255,255,0.85);
    cursor: grab;
    z-index: 5;
}

.hotspot.active {
    outline: 3px solid rgba(255,255,255,0.25);
    z-index: 10;
}

.hotspot:hover {
    transform: translate(-50%, -50%) scale(1.06);
}

.hint {
    margin-top: 14px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #e5e7eb;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #94a3b8;
}

.field textarea {
    min-height: 96px;
    resize: vertical;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sidebar-section + .sidebar-section {
    margin-top: 20px;
}

.coords-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.coords-pill {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
}

.coords-pill strong {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
    font-weight: 600;
}

.list {
    display: grid;
    gap: 10px;
    max-height: 320px;
    overflow: auto;
    padding-right: 4px;
}

.item {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    border-radius: 14px;
    padding: 12px;
    transition: 0.2s ease;
}

.item.active {
    border-color: rgba(245,158,11,0.6);
    background: rgba(245,158,11,0.08);
}

.item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.item-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.item-sub {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
    word-break: break-all;
}

.badge {
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--primary);
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
}

.item-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.item-actions button {
    flex: 1;
    padding: 10px 12px;
    font-size: 12px;
}

.json-output {
    background: #020617;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1.6;
    max-height: 260px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.empty-state {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

.footer-note {
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

@media (max-width: 980px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .editor-stage {
        min-height: 380px;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 20px, 100%);
        margin: 20px auto;
    }

    .topbar {
        align-items: flex-start;
    }

    .brand h1 {
        font-size: 24px;
    }

    .field-row,
    .coords-box {
        grid-template-columns: 1fr;
    }

    .hotspot {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}