@font-face {
    font-family: 'PP Hatton';
    src: url('fonts/PPHatton-Ultralight.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PP Hatton';
    src: url('fonts/PPHatton-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PP Hatton';
    src: url('fonts/PPHatton-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #181A10;
    --bg-2: #21231A;
    --bg-card: rgba(28, 30, 18, 0.92);
    --bg-card-hover: rgba(36, 38, 24, 0.98);

    --gold-1: #8F6538;
    --gold-2: #9F7F44;
    --gold-3: #C3C26E;
    --gold-4: #E2EAA2;
    --gold-text: #D6C181;

    --cream: #F3EDDF;
    --cream-muted: rgba(243, 237, 223, 0.55);
    --olive: #656950;
    --olive-dark: #3F4230;

    --border-gold: rgba(195, 194, 110, 0.18);
    --border-gold-hover: rgba(195, 194, 110, 0.45);

    --color-vendas: #D4A843;
    --color-os: #7EB8D9;
    --color-ticket: #90C976;
    --color-meta: #6BAEAD;
    --color-mes: #B68DD9;
    --color-red: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 5% 5%, rgba(143, 101, 56, 0.09) 0%, transparent 45%),
        radial-gradient(ellipse at 95% 95%, rgba(101, 105, 80, 0.11) 0%, transparent 45%);
    color: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background ornaments */
.bg-ornament {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
    will-change: transform;
    contain: layout style paint;
}

.ornament-1 {
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(143, 101, 56, 0.13) 0%, transparent 70%);
    top: -120px; left: -160px;
    animation: driftSlow 28s infinite alternate ease-in-out;
}

.ornament-2 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(101, 105, 80, 0.11) 0%, transparent 70%);
    bottom: -100px; right: -120px;
    animation: driftSlow 32s infinite alternate-reverse ease-in-out;
}

.ornament-3 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(195, 194, 110, 0.07) 0%, transparent 70%);
    top: 48%; left: 44%;
    animation: driftSlow 22s infinite alternate ease-in-out;
    animation-delay: -9s;
}

@keyframes driftSlow {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(45px, 35px, 0); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 42px;
    position: relative;
    z-index: 1;
}

.content-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.col-left { display: flex; flex-direction: column; }
.col-right { display: flex; flex-direction: column; }

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

/* ===== HEADER ===== */
header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 18px;
    gap: 16px;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.brand-logo-img {
    height: 90px;
    width: auto;
    filter: drop-shadow(0 0 12px rgba(195, 194, 110, 0.25));
    transition: filter 0.3s ease;
}

.brand-logo-img:hover {
    filter: drop-shadow(0 0 22px rgba(195, 194, 110, 0.5));
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.page-title {
    font-family: 'PP Hatton', serif;
    font-size: 1.3rem;
    font-weight: 300;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    background: linear-gradient(130deg, #8F6538 0%, #C3C26E 50%, #E2EAA2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(24, 26, 16, 0.85);
    padding: 14px 24px;
    border-radius: 32px;
    border: 1px solid var(--border-gold);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.status-label {
    font-size: 0.7rem;
    color: var(--gold-text);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 3px;
}

.status-time {
    font-size: 0.88rem;
    color: var(--cream-muted);
}

.pulse-dot {
    width: 10px; height: 10px;
    background-color: var(--color-meta);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulseBlue 2s infinite;
}

.pulse-dot-gold {
    background-color: var(--gold-3);
    animation: pulseGold 2s infinite;
}

@keyframes pulseBlue {
    0%   { box-shadow: 0 0 0 0 rgba(107, 174, 173, 0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(107, 174, 173, 0); }
    100% { box-shadow: 0 0 0 0 rgba(107, 174, 173, 0); }
}

@keyframes pulseGold {
    0%   { box-shadow: 0 0 0 0 rgba(195, 194, 110, 0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(195, 194, 110, 0); }
    100% { box-shadow: 0 0 0 0 rgba(195, 194, 110, 0); }
}

/* ===== DIVIDER ===== */
.divider {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
    opacity: 0.45;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-3), transparent);
}

.divider-ornament {
    font-size: 0.85rem;
    color: var(--gold-3);
    flex-shrink: 0;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 18px;
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 0;
    contain: layout style;
}

.card-glow {
    position: absolute;
    top: -30px; right: -30px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: var(--color-vendas);
    opacity: 0.08;
    filter: blur(36px);
    pointer-events: none;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-gold);
}

.section-header h2 {
    font-family: 'PP Hatton', serif;
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--cream);
    letter-spacing: 0.03em;
}

/* ===== FORM ===== */
.form-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cream-muted);
    margin-bottom: 12px;
}

.form-input {
    width: 100%;
    background: rgba(24, 26, 16, 0.6);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 16px 18px;
    color: var(--cream);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-input::placeholder {
    color: var(--cream-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--border-gold-hover);
    box-shadow: 0 0 0 3px rgba(195, 194, 110, 0.10);
}

.form-button {
    width: 100%;
    margin-top: 20px;
    padding: 16px 24px;
    border: 1px solid rgba(195, 194, 110, 0.45);
    border-radius: 14px;
    background: linear-gradient(130deg, rgba(143, 101, 56, 0.25) 0%, rgba(195, 194, 110, 0.18) 100%);
    color: var(--cream);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.form-button:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--gold-3);
    box-shadow: 0 12px 32px rgba(195, 194, 110, 0.18);
}

.form-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(243, 237, 223, 0.25);
    border-top-color: var(--gold-3);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESULT (compact horizontal) ===== */
.result-card-compact {
    padding: 24px 28px;
    animation: fadeInUp 0.5s ease backwards;
}

.result-row {
    display: flex;
    align-items: center;
    gap: 22px;
}

.result-row .card-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 168, 67, 0.10);
    color: var(--color-vendas);
    border: 1px solid rgba(212, 168, 67, 0.25);
    flex-shrink: 0;
}

.result-row .card-icon svg { width: 26px; height: 26px; }

.result-main {
    flex: 1;
    min-width: 0;
}

.result-main h3 {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cream-muted);
    margin-bottom: 4px;
}

.result-main .number {
    font-family: 'PP Hatton', serif;
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--color-vendas);
    text-shadow: 0 0 22px rgba(212, 168, 67, 0.30);
    white-space: nowrap;
}

.result-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 2px;
    flex-shrink: 0;
}

.result-meta .meta-km {
    font-family: 'PP Hatton', serif;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--gold-text);
    letter-spacing: 0.02em;
}

.result-meta .meta-duracao {
    font-size: 0.78rem;
    color: var(--cream-muted);
}

/* Mapa estático da rota */
.result-mapa-link {
    display: block;
    margin-top: 18px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-gold);
    line-height: 0;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.result-mapa-link:hover {
    border-color: var(--border-gold-hover);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.result-mapa {
    display: block;
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
}

/* Message block (editable + copy) */
.msg-block {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px dashed rgba(195, 194, 110, 0.18);
}

.msg-textarea {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    padding: 12px 14px;
    line-height: 1.45;
}

.btn-copiar {
    margin-top: 12px;
    padding: 12px 20px;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
}

.btn-copiar.copied {
    border-color: var(--color-ticket);
    background: linear-gradient(130deg, rgba(144, 201, 118, 0.20) 0%, rgba(144, 201, 118, 0.10) 100%);
    color: var(--color-ticket);
}

.result-details {
    margin-top: 18px;
    text-align: left;
    border-top: 1px solid var(--border-gold);
    padding-top: 14px;
}

.result-details summary {
    cursor: pointer;
    color: var(--gold-text);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    list-style: none;
    padding: 6px 0;
    user-select: none;
}

.result-details summary::-webkit-details-marker { display: none; }

.result-details summary::after {
    content: '+';
    float: right;
    color: var(--gold-3);
    font-size: 1.1rem;
    transition: transform 0.25s ease;
}

.result-details[open] summary::after { content: '−'; }

.details-grid {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    font-size: 0.9rem;
}

.details-grid > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(195, 194, 110, 0.10);
}

.details-grid > div:last-child { border-bottom: none; }

.details-grid span {
    color: var(--cream-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.details-grid strong {
    color: var(--cream);
    font-weight: 500;
    text-align: right;
}

/* ===== PLACEHOLDER (col direita vazia) ===== */
.placeholder-card {
    text-align: center;
    padding: 48px 24px;
    border-style: dashed;
    border-color: rgba(195, 194, 110, 0.18);
    background: rgba(28, 30, 18, 0.55);
}

.placeholder-icon {
    font-size: 1.6rem;
    color: var(--gold-3);
    opacity: 0.55;
    margin-bottom: 14px;
}

.placeholder-card p {
    color: var(--cream-muted);
    font-size: 0.92rem;
    font-weight: 300;
}

/* ===== ERROR ===== */
.error-card {
    text-align: center;
    padding: 36px 32px;
    border-color: rgba(239, 68, 68, 0.35);
    animation: fadeInUp 0.5s ease backwards;
}

.error-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-red);
    border: 1px solid rgba(239, 68, 68, 0.35);
    font-family: 'PP Hatton', serif;
    font-weight: 700;
    font-size: 1.6rem;
}

.error-card h3 {
    font-family: 'PP Hatton', serif;
    font-weight: 400;
    font-size: 1.25rem;
    color: var(--cream);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}

.error-card p {
    color: var(--cream-muted);
    font-size: 0.92rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.form-card { animation: fadeInUp 0.6s ease backwards; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .container { padding: 28px 18px; }
    header {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
        margin-bottom: 28px;
    }
    .header-logo { grid-column: 1; grid-row: 1; }
    .header-right { grid-column: 2; grid-row: 1; justify-content: flex-end; }
    .header-center { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
    .brand-logo-img { height: 70px; }
    .page-title { font-size: 1.15rem; letter-spacing: 0.16em; }
    .status-indicator { padding: 10px 14px; gap: 10px; }
    .status-label { font-size: 0.62rem; }
    .status-time { font-size: 0.78rem; }
    .divider { margin-bottom: 28px; }
    .card { padding: 20px 18px; border-radius: 14px; }
    .result-card-compact { padding: 22px 18px; }
    .result-row { flex-direction: column; align-items: flex-start; gap: 14px; }
    .result-meta { align-items: flex-start; text-align: left; flex-direction: row; gap: 10px; }
    .result-main .number { white-space: normal; }
    .bg-ornament { display: none; }
    .card { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(28, 30, 18, 0.98); }
    .status-indicator { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(24, 26, 16, 0.95); }
}

@media (max-width: 480px) {
    .container { padding: 20px 14px; }
    .brand-logo-img { height: 56px; }
    .page-title { font-size: 0.95rem; letter-spacing: 0.12em; }
    .status-label { display: none; }
    .status-time { font-size: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
    .bg-ornament { animation: none; }
    .pulse-dot, .pulse-dot-gold { animation: none; }
    .form-card, .result-card-compact, .error-card { animation: none; }
}
