/* =====================================================================
   Orçamentos de Eventos — estilos, mobile-first
   Sistema de marca: Rising Red / Steel Grey / Light Grey / Ink Black / Ivory
   Tipografia: Lato (texto) + Eurostyle (títulos — ver nota abaixo)
   ===================================================================== */

#oe-app, .oe-root {
	--oe-bg: #E6E7E8;          /* Light Grey */
	--oe-surface: #FFFFFF;     /* Ivory */
	--oe-ink: #231F20;         /* Ink Black */
	--oe-ink-soft: #4D4D4F;    /* Steel Grey — só sobre superfícies claras */
	--oe-ink-faint: #8A8A8C;   /* tom mais claro de Steel Grey, texto terciário sobre claro */
	--oe-on-dark-2: rgba(255,255,255,.66); /* texto secundário sobre fundo escuro (nunca Steel Grey aqui — falha o contraste) */
	--oe-on-dark-3: rgba(255,255,255,.40);

	--oe-red: #E31837;         /* Rising Red — o único acento da marca */
	--oe-red-dark: #B01329;
	--oe-red-soft: #FBE7EA;

	/* aliases para manter compatibilidade com o resto da folha de estilos */
	--oe-primary: var(--oe-red);
	--oe-primary-dark: var(--oe-red-dark);
	--oe-primary-soft: var(--oe-red-soft);
	--oe-accent: var(--oe-red);
	--oe-accent-dark: var(--oe-red-dark);
	--oe-success: var(--oe-red);
	--oe-success-soft: var(--oe-red-soft);
	--oe-danger: var(--oe-red);
	--oe-danger-soft: var(--oe-red-soft);
	--oe-warn: var(--oe-ink);
	--oe-warn-soft: var(--oe-bg);

	--oe-border: rgba(35,31,32,.12);
	--oe-radius: 14px;
	--oe-radius-sm: 9px;
	--oe-cut: 12px; /* tamanho do corte diagonal — a assinatura visual da marca */
	--oe-shadow: 0 1px 2px rgba(35,31,32,.05), 0 10px 26px -14px rgba(35,31,32,.30);
	--oe-nav-h: 62px;
	--oe-header-h: 56px;

	--oe-font-display: 'Eurostyle', 'Michroma', 'Arial Narrow', sans-serif;
	/* Eurostyle é uma fonte de fundição licenciada, sem distribuição via
	   serviços de web font gratuitos — a Michroma serve de substituta
	   próxima (geométrica, estendida) nesta pré-visualização. Basta
	   adicionar o @font-face da fonte licenciada (com font-family:
	   'Eurostyle') em qualquer folha de estilos carregada a seguir a esta,
	   e ela assume o lugar automaticamente, sem tocar em mais nada aqui. */
	--oe-font-body: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	font-family: var(--oe-font-body);
	color: var(--oe-ink);
	box-sizing: border-box;
}

#oe-app *, .oe-root *, #oe-app *::before, .oe-root *::before, #oe-app *::after, .oe-root *::after {
	box-sizing: inherit;
}

.oe-root {
	background: var(--oe-bg);
	min-height: 100vh;
	line-height: 1.4;
}

/* corte diagonal — utilitário reutilizado em botões, miniaturas e cartões */
.oe-cut-tl { clip-path: polygon(var(--oe-cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--oe-cut)); }
.oe-cut-br { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--oe-cut)), calc(100% - var(--oe-cut)) 100%, 0 100%); }

/* ---------------------------------------------------------------------
   Ecrã de login
   ------------------------------------------------------------------- */
.oe-login-screen {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	min-height: 100vh;
	background: var(--oe-ink);
}

.oe-login-card {
	width: 100%;
	max-width: 380px;
	background: #FFFFFF;
	background: var(--oe-surface);
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 24px 60px -20px rgba(0,0,0,.6);
}

.oe-login-hero {
	position: relative;
	background: var(--oe-red);
	clip-path: polygon(0 0, 100% 0, 100% 72%, 0 100%);
	padding: 30px 28px 46px;
	text-align: center;
}

.oe-login-mark {
	width: 46px; height: 46px;
	margin: 0 auto 12px;
	background: var(--oe-surface);
	color: var(--oe-red);
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-family: var(--oe-font-display);
	font-size: 14px;
	letter-spacing: .01em;
}

.oe-login-hero h1 {
	font-size: 18px;
	font-weight: 900;
	margin: 0 0 4px;
	letter-spacing: -0.01em;
	color: #fff;
}

.oe-login-hero p {
	margin: 0;
	color: rgba(255,255,255,.82);
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.oe-login-body { padding: 26px 28px 30px; }

.oe-login-form { display: flex; flex-direction: column; gap: 14px; }

.oe-alert {
	padding: 10px 12px;
	border-radius: var(--oe-radius-sm);
	font-size: 13px;
	margin-bottom: 16px;
}
.oe-alert-erro { background: var(--oe-red-soft); color: var(--oe-red-dark); }
.oe-alert-sucesso { background: var(--oe-bg); color: var(--oe-ink); }

/* ---------------------------------------------------------------------
   Campos de formulário
   ------------------------------------------------------------------- */
.oe-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
	color: var(--oe-ink-soft);
	font-weight: 700;
}

.oe-field input[type="text"],
.oe-field input[type="email"],
.oe-field input[type="tel"],
.oe-field input[type="password"],
.oe-field input[type="number"],
.oe-field input[type="date"],
.oe-field select,
.oe-field textarea {
	font-size: 16px; /* evita zoom automático no iOS */
	font-family: var(--oe-font-body);
	padding: 12px 14px;
	border-radius: var(--oe-radius-sm);
	border: 1.5px solid var(--oe-border);
	background: #FFFFFF;
	background: var(--oe-surface);
	color: #231F20;
	color: var(--oe-ink);
	font-weight: 400;
	width: 100%;
	appearance: none;
	-webkit-appearance: none;
}

.oe-field textarea { resize: vertical; min-height: 72px; font-family: inherit; }

.oe-field input:focus,
.oe-field select:focus,
.oe-field textarea:focus {
	outline: none;
	border-color: var(--oe-red);
	box-shadow: 0 0 0 3px var(--oe-red-soft);
}

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

.oe-form { display: flex; flex-direction: column; gap: 14px; }
.oe-form-section-title {
	font-family: var(--oe-font-display);
	font-size: 10.5px;
	letter-spacing: .08em;
	color: var(--oe-ink-faint);
	margin: 6px 0 -4px;
}

/* Segmento de dois botões (particular/empresa, sexo, estado…) */
.oe-segment {
	display: flex;
	border: 1.5px solid var(--oe-border);
	border-radius: var(--oe-radius-sm);
	overflow: hidden;
}
.oe-segment button {
	flex: 1;
	border: none;
	background: #FFFFFF;
	background: var(--oe-surface);
	padding: 11px 8px;
	font-family: var(--oe-font-body);
	font-size: 14px;
	font-weight: 700;
	color: var(--oe-ink-soft);
	cursor: pointer;
}
.oe-segment button.is-active {
	background: var(--oe-ink);
	color: #fff;
}

/* Lista de chips para funcionalidades booleanas da viatura (ADAS, ABS, etc.) */
.oe-chip-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.oe-chip {
	display: flex;
	align-items: center;
	gap: 8px;
	border: 1.5px solid var(--oe-border);
	border-radius: var(--oe-radius-sm);
	padding: 10px 12px;
	font-size: 13.5px;
	font-weight: 700;
	color: #4D4D4F;
	color: var(--oe-ink-soft);
	cursor: pointer;
	user-select: none;
}
.oe-chip input { width: 17px; height: 17px; accent-color: var(--oe-red); }
.oe-chip.is-checked { border-color: var(--oe-red); background: var(--oe-red-soft); color: var(--oe-red-dark); }

/* Slots de foto (principal + 3 interiores) */
.oe-photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.oe-photo-slot {
	position: relative;
	border: 1.5px dashed var(--oe-border);
	border-radius: var(--oe-radius-sm);
	aspect-ratio: 4 / 3;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 6px;
	color: var(--oe-ink-faint);
	font-size: 12px;
	font-weight: 700;
	background: var(--oe-surface);
	cursor: pointer;
	overflow: hidden;
	text-align: center;
	padding: 6px;
}
.oe-photo-slot img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.oe-photo-slot .oe-photo-remove {
	position: absolute; top: 6px; right: 6px; z-index: 2;
	width: 24px; height: 24px; border-radius: 50%;
	background: rgba(35,31,32,.7); color: #fff; border: none;
	display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer;
}
.oe-photo-slot.oe-photo-principal { grid-column: 1 / -1; aspect-ratio: 16/9; clip-path: polygon(0 0,100% 0,100% 100%,20px 100%,0 calc(100% - 20px)); }

/* ---------------------------------------------------------------------
   Botões
   ------------------------------------------------------------------- */
.oe-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
	padding: 13px 18px;
	font-family: var(--oe-font-body);
	font-size: 14.5px;
	font-weight: 800;
	letter-spacing: .01em;
	cursor: pointer;
	text-decoration: none;
	line-height: 1;
	transition: transform .05s ease;
}
.oe-btn:active { transform: scale(.98); }
.oe-btn-block { width: 100%; }
.oe-btn-primary { background: var(--oe-red); color: #fff; clip-path: polygon(0 0,100% 0,100% 100%,14px 100%,0 calc(100% - 14px)); }
.oe-btn-primary:hover { background: var(--oe-red-dark); }
.oe-btn-accent { background: var(--oe-ink); color: #fff; clip-path: polygon(0 0,100% 0,100% 100%,14px 100%,0 calc(100% - 14px)); }
.oe-btn-accent:hover { background: #000; }
.oe-btn-secondary { background: var(--oe-bg); color: var(--oe-ink); }
.oe-btn-danger { background: transparent; color: var(--oe-red); }
.oe-btn-danger:hover { background: var(--oe-red-soft); }
.oe-btn-ghost { background: transparent; color: var(--oe-ink-soft); padding: 8px 10px; }
.oe-btn-sm { padding: 8px 12px; font-size: 12.5px; }
.oe-btn[disabled] { opacity: .5; pointer-events: none; }
.oe-fab {
	position: fixed;
	right: 18px;
	bottom: calc(var(--oe-nav-h) + 18px);
	width: 56px; height: 56px;
	border-radius: 50%;
	background: var(--oe-red);
	color: #fff;
	font-size: 26px;
	border: none;
	box-shadow: 0 12px 26px -6px rgba(227,24,55,.55);
	display: flex; align-items: center; justify-content: center;
	cursor: pointer;
	z-index: 40;
}

/* ---------------------------------------------------------------------
   Cabeçalho e navegação
   ------------------------------------------------------------------- */
.oe-header {
	position: sticky;
	top: 0;
	z-index: 30;
	height: var(--oe-header-h);
	background: var(--oe-surface);
	border-bottom: 1px solid var(--oe-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px;
}
.oe-header h2 { font-family: var(--oe-font-display); font-size: 14px; margin: 0; letter-spacing: .02em; }
.oe-header-actions { display: flex; align-items: center; gap: 6px; }

.oe-main {
	max-width: 640px;
	margin: 0 auto;
	padding: 16px 16px calc(var(--oe-nav-h) + 28px);
}

.oe-nav {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	height: var(--oe-nav-h);
	background: var(--oe-surface);
	border-top: 1px solid var(--oe-border);
	display: flex;
	z-index: 35;
	padding-bottom: env(safe-area-inset-bottom, 0);
}
.oe-nav-item {
	position: relative;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	border: none;
	background: none;
	color: var(--oe-ink-faint);
	font-size: 10.5px;
	font-weight: 700;
	cursor: pointer;
	padding: 6px 2px;
}
.oe-nav-item .oe-nav-icon { font-size: 19px; line-height: 1; }
.oe-nav-item.is-active { color: var(--oe-red); }
.oe-nav-item.is-active::after {
	content: "";
	position: absolute; bottom: 1px; left: 50%;
	transform: translateX(-50%) rotate(-12deg);
	width: 13px; height: 2.5px; background: var(--oe-red);
}

/* ---------------------------------------------------------------------
   Cartões / listas
   ------------------------------------------------------------------- */
.oe-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.oe-stat-card {
	background: #FFFFFF;
	background: var(--oe-surface);
	border-radius: var(--oe-radius);
	padding: 16px;
	box-shadow: var(--oe-shadow);
	border: 1px solid var(--oe-border);
	border-top: 3px solid var(--oe-border);
}
.oe-stat-card .oe-stat-value { font-family: var(--oe-font-display); font-size: 22px; letter-spacing: -.01em; color: var(--oe-ink); font-variant-numeric: tabular-nums; }
.oe-stat-card .oe-stat-label { font-size: 12px; color: var(--oe-ink-soft); font-weight: 700; margin-top: 4px; }
.oe-stat-card.is-accent { border-top-color: var(--oe-red); }
.oe-stat-card.is-accent .oe-stat-value { color: var(--oe-red); }

.oe-section-title {
	font-family: var(--oe-font-display);
	font-size: 11.5px;
	letter-spacing: .05em;
	color: var(--oe-ink);
	margin: 22px 0 10px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.oe-card-list { display: flex; flex-direction: column; gap: 10px; }
.oe-card {
	background: #FFFFFF;
	background: var(--oe-surface);
	border-radius: var(--oe-radius);
	padding: 14px 16px;
	box-shadow: var(--oe-shadow);
	cursor: pointer;
	border: 1px solid var(--oe-border);
	border-left: 3px solid var(--oe-border);
}
.oe-card:active { border-left-color: var(--oe-red); }
.oe-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.oe-card-title { font-size: 15px; font-weight: 800; margin: 0 0 2px; color: var(--oe-ink); }
.oe-card-sub { font-size: 13px; color: var(--oe-ink-soft); margin: 0; }
.oe-card-meta { display: flex; gap: 14px; margin-top: 10px; font-size: 12.5px; color: var(--oe-ink-soft); flex-wrap: wrap; }
.oe-card-meta span { display: flex; align-items: center; gap: 4px; }

.oe-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: .02em;
	white-space: nowrap;
}
.oe-badge-planeado { background: var(--oe-bg); color: var(--oe-ink-soft); }
.oe-badge-em_curso { background: var(--oe-red); color: #fff; }
.oe-badge-terminado { background: var(--oe-ink-soft); color: #fff; }
.oe-badge-activo { background: var(--oe-red-soft); color: var(--oe-red-dark); }
.oe-badge-inactivo { background: var(--oe-bg); color: var(--oe-ink-faint); }
.oe-badge-particular { background: var(--oe-bg); color: var(--oe-ink); }
.oe-badge-empresa { background: var(--oe-ink); color: #fff; }

.oe-vehicle-thumb {
	width: 100%; aspect-ratio: 16/9;
	background: var(--oe-ink) center/cover no-repeat;
	margin-bottom: 10px;
	display: flex; align-items: center; justify-content: center;
	color: #fff;
	font-size: 24px;
	clip-path: polygon(0 0,100% 0,100% 100%,24px 100%,0 calc(100% - 24px));
}

.oe-searchbar { display: flex; gap: 8px; margin-bottom: 14px; }
.oe-searchbar input {
	flex: 1;
	font-family: var(--oe-font-body);
	font-size: 15px;
	padding: 11px 14px;
	border-radius: var(--oe-radius-sm);
	border: 1.5px solid var(--oe-border);
	background: var(--oe-surface);
}
.oe-searchbar input:focus { outline: none; border-color: var(--oe-red); }

.oe-empty {
	text-align: center;
	padding: 40px 16px;
	color: var(--oe-ink-soft);
}
.oe-empty .oe-empty-icon { font-size: 30px; margin-bottom: 10px; display: block; color: var(--oe-ink-faint); }

.oe-table-mini { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.oe-table-mini th { text-align: left; color: var(--oe-ink-faint); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; padding-bottom: 8px; }
.oe-table-mini td { padding: 9px 0; border-top: 1px solid var(--oe-border); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   Bottom sheet (modal deslizante para formulários)
   ------------------------------------------------------------------- */
.oe-sheet-backdrop {
	position: fixed; inset: 0;
	background: rgba(35,31,32,.55);
	background: var(--oe-scrim, rgba(35,31,32,.55));
	z-index: 50;
	display: flex;
	align-items: flex-end;
	animation: oe-fade .15s ease;
}
.oe-sheet {
	background: #FFFFFF;
	background: var(--oe-surface);
	width: 100%;
	max-width: 640px;
	margin: 0 auto;
	border-radius: 20px 20px 0 0;
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	animation: oe-slide-up .2s ease;
	position: relative;
	overflow: hidden;
}
.oe-sheet::before {
	content: "";
	position: absolute; top: 0; left: 0; width: 64px; height: 4px;
	background: var(--oe-red);
}
.oe-sheet-handle { width: 40px; height: 4px; background: var(--oe-border); border-radius: 999px; margin: 12px auto 2px; }
.oe-sheet-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 10px 18px 14px;
	border-bottom: 1px solid var(--oe-border);
}
.oe-sheet-header h3 { margin: 0; font-family: var(--oe-font-display); font-size: 14px; letter-spacing: .01em; font-weight: 400; }
.oe-sheet-body { padding: 16px 18px; overflow-y: auto; }
.oe-sheet-footer { padding: 14px 18px; border-top: 1px solid var(--oe-border); display: flex; gap: 10px; }
.oe-sheet-footer .oe-btn { flex: 1; }

@keyframes oe-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes oe-slide-up { from { transform: translateY(24px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }

/* ---------------------------------------------------------------------
   Loader / toasts
   ------------------------------------------------------------------- */
.oe-boot-loader {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	color: var(--oe-ink-soft);
	font-size: 14px;
	font-weight: 700;
}
.oe-spinner {
	width: 18px; height: 18px;
	border: 2.5px solid var(--oe-border);
	border-top-color: var(--oe-red);
	border-radius: 50%;
	animation: oe-spin .7s linear infinite;
	display: inline-block;
}
@keyframes oe-spin { to { transform: rotate(360deg); } }

.oe-toast-wrap {
	position: fixed; top: 12px; left: 0; right: 0;
	display: flex; flex-direction: column; align-items: center; gap: 8px;
	z-index: 80; pointer-events: none;
	padding: 0 16px;
}
.oe-toast {
	background: var(--oe-ink);
	color: #fff;
	padding: 11px 16px;
	font-size: 13.5px;
	font-weight: 700;
	box-shadow: 0 10px 24px -8px rgba(0,0,0,.4);
	max-width: 420px;
	animation: oe-fade .15s ease;
}
.oe-toast.is-erro { background: var(--oe-red); }
.oe-toast.is-sucesso { background: var(--oe-ink); }

/* Credenciais reveladas após criar consultor */
.oe-credentials-box {
	background: #E6E7E8;
	background: var(--oe-bg);
	border: 1.5px dashed var(--oe-ink-faint);
	border-radius: var(--oe-radius-sm);
	padding: 12px 14px;
	font-size: 13.5px;
	color: var(--oe-ink);
}
.oe-credentials-box code { background: rgba(35,31,32,.08); padding: 2px 6px; border-radius: 5px; font-weight: 700; }

/* ---------------------------------------------------------------------
   Assistente de Orçamento (passos, linhas seleccionáveis, resumo)
   ------------------------------------------------------------------- */
.oe-wizard-dots { display: flex; gap: 6px; margin-bottom: 16px; }
.oe-wizard-dot { flex: 1; height: 3px; background: var(--oe-border); }
.oe-wizard-dot.is-active { background: var(--oe-red); }
.oe-wizard-dot.is-done { background: var(--oe-ink); }

.oe-select-row {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 12px; border: 1.5px solid var(--oe-border); border-radius: var(--oe-radius-sm);
	margin-bottom: 8px; cursor: pointer; color: var(--oe-red);
}
.oe-select-row.is-selected { border-color: var(--oe-red); background: var(--oe-red-soft); }

.oe-review-card {
	background: var(--oe-bg);
	border-radius: var(--oe-radius-sm);
	padding: 12px 14px;
	margin-bottom: 10px;
}
.oe-review-label { margin: 0 0 2px; font-family: var(--oe-font-display); font-size: 9.5px; letter-spacing: .06em; color: var(--oe-ink-faint); }
.oe-review-value { margin: 0; font-size: 14px; font-weight: 800; color: var(--oe-ink); }
.oe-review-sub { margin: 2px 0 0; font-size: 12px; color: var(--oe-ink-soft); }

/* ---------------------------------------------------------------------
   Ecrãs largos (tablet / desktop): mantemos a "moldura" de app centrada
   ------------------------------------------------------------------- */
@media (min-width: 720px) {
	.oe-nav { border-radius: 0; }
	.oe-stat-grid { grid-template-columns: repeat(4, 1fr); }
	.oe-photo-grid { grid-template-columns: repeat(4, 1fr); }
	.oe-photo-slot.oe-photo-principal { grid-column: span 2; aspect-ratio: 4/3; }
}

@media (max-width: 400px) {
	.oe-field-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.oe-spinner, .oe-sheet, .oe-sheet-backdrop, .oe-toast { animation: none; }
}
