/**
 * Voicemail Lola — light theme, vintage answering machine look.
 * Visibility is driven entirely by [data-state] on .vml-widget, so the
 * JS only needs to flip that one attribute to move through the flow.
 */
.vml-widget {
	--vml-bg:               #efefef;
	--vml-bg-panel:         #f7f7f7;
	--vml-border:           rgba(0, 0, 0, .08);
	--vml-display-bg:       #ffffff;
	--vml-display-border:   #d6d6d6;
	--vml-text:             #2a2a2a;
	--vml-text-dim:         #6c6c6c;
	--vml-accent:           #8c6b1f;
	--vml-counter:          #d63333;
	--vml-led-off:          #c9c9c9;
	--vml-led-on:           #e53935;
	--vml-progress-bg:      rgba(0, 0, 0, .08);
	--vml-progress-fill-a:  #f0a000;
	--vml-progress-fill-b:  #e53935;

	--vml-record:           #d33125;
	--vml-record-hover:     #ec3d2f;
	--vml-record-disabled:  #b9b9b9;
	--vml-stop:             #4a4a4a;
	--vml-stop-hover:       #5d5d5d;
	--vml-send:             #2d8a4a;
	--vml-send-hover:       #34a35a;
	--vml-redo:             #8a8a8a;
	--vml-redo-hover:       #a0a0a0;

	--vml-radius:           14px;
	--vml-shadow:           0 4px 14px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);

	box-sizing: border-box;
	max-width: 480px;
	margin: 1.5rem auto;
	padding: 1.5rem;
	background: linear-gradient(180deg, var(--vml-bg-panel), var(--vml-bg));
	color: var(--vml-text);
	border: 1px solid var(--vml-border);
	border-radius: var(--vml-radius);
	box-shadow: var(--vml-shadow);
	font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.vml-widget *,
.vml-widget *::before,
.vml-widget *::after {
	box-sizing: inherit;
}

.vml-widget [hidden] {
	display: none !important;
}

.vml-title {
	margin: 0 0 1rem;
	font-size: 1.1rem;
	letter-spacing: .04em;
	text-align: center;
	color: var(--vml-accent);
}

/* Display "terminal" panel */
.vml-display {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .9rem 1rem;
	background: var(--vml-display-bg);
	border: 1px solid var(--vml-display-border);
	border-radius: 8px;
	margin-bottom: .9rem;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, .04);
}

.vml-led {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--vml-led-off);
	box-shadow: inset 0 -1px 2px rgba(0, 0, 0, .15);
	flex-shrink: 0;
	transition: background .15s ease, box-shadow .15s ease;
}

.vml-widget[data-state="recording"] .vml-led {
	background: var(--vml-led-on);
	box-shadow: 0 0 8px rgba(229, 57, 53, .55), inset 0 -1px 2px rgba(0, 0, 0, .15);
	animation: vml-blink 1s infinite;
}

@keyframes vml-blink {
	0%, 100% { opacity: 1; }
	50%      { opacity: .45; }
}

.vml-counter {
	font-family: "Courier New", ui-monospace, monospace;
	font-size: 1.6rem;
	font-weight: 700;
	letter-spacing: .12em;
	color: var(--vml-counter);
	flex-shrink: 0;
}

.vml-status {
	margin-left: auto;
	font-size: .85rem;
	color: var(--vml-text-dim);
	font-style: italic;
	text-align: right;
}

.vml-progress {
	height: 6px;
	background: var(--vml-progress-bg);
	border-radius: 3px;
	overflow: hidden;
	margin-bottom: 1.1rem;
}

.vml-progress-fill {
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, var(--vml-progress-fill-a), var(--vml-progress-fill-b));
	transition: width .2s linear;
}

/* Controls (record / stop) */
.vml-controls {
	display: flex;
	justify-content: center;
	gap: .8rem;
	flex-wrap: wrap;
	margin-bottom: 1rem;
}

/* Hide the whole controls block once we've moved past recording */
.vml-widget[data-state="encoding"] .vml-controls,
.vml-widget[data-state="recorded"] .vml-controls,
.vml-widget[data-state="sending"] .vml-controls,
.vml-widget[data-state="done"]    .vml-controls {
	display: none;
}

.vml-btn {
	appearance: none;
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-size: .95rem;
	font-weight: 600;
	padding: .8rem 1.3rem;
	border-radius: 10px;
	display: inline-flex;
	align-items: center;
	gap: .6rem;
	transition: background .15s ease, transform .05s ease, box-shadow .15s ease, opacity .15s ease;
	color: #fff;
	background: var(--vml-record);
	box-shadow: 0 2px 6px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .15);
}

.vml-btn:hover:not(:disabled) {
	background: var(--vml-record-hover);
}

.vml-btn:active:not(:disabled) {
	transform: translateY(1px);
}

.vml-btn:disabled {
	cursor: not-allowed;
}

.vml-btn-icon {
	font-size: 1rem;
	line-height: 1;
}

/* Stop button is hidden by default and only revealed while recording */
.vml-btn-stop {
	background: var(--vml-stop);
	display: none;
}
.vml-widget[data-state="recording"] .vml-btn-stop {
	display: inline-flex;
}
.vml-btn-stop:hover:not(:disabled) {
	background: var(--vml-stop-hover);
}

/* Record button visually disabled (greyed out, not clickable) once a flow has started */
.vml-widget[data-state="preparing"]        .vml-btn-record,
.vml-widget[data-state="playing-greeting"] .vml-btn-record,
.vml-widget[data-state="beep"]             .vml-btn-record,
.vml-widget[data-state="recording"]        .vml-btn-record {
	background: var(--vml-record-disabled);
	color: #f0f0f0;
	box-shadow: none;
	cursor: not-allowed;
	pointer-events: none;
}

/* Review section: audio playback + fields + action buttons */
.vml-review {
	margin-top: .5rem;
	padding-top: 1rem;
	border-top: 1px dashed var(--vml-border);
}

.vml-playback {
	width: 100%;
	/* 30px gap between the audio track and the validate/redo buttons (with fields in between) */
	margin-bottom: 30px;
}

.vml-fields {
	display: flex;
	flex-direction: column;
	gap: .65rem;
	margin-bottom: 1rem;
}

.vml-field {
	display: flex;
	flex-direction: column;
	gap: .25rem;
	font-size: .85rem;
	color: var(--vml-text-dim);
}

.vml-input {
	font-family: inherit;
	font-size: .95rem;
	padding: .55rem .7rem;
	border-radius: 6px;
	border: 1px solid var(--vml-display-border);
	background: #fff;
	color: var(--vml-text);
}

.vml-input:focus {
	outline: 2px solid var(--vml-accent);
	outline-offset: 1px;
}

.vml-review-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
	justify-content: center;
}

.vml-btn-send {
	background: var(--vml-send);
}
.vml-btn-send:hover:not(:disabled) {
	background: var(--vml-send-hover);
}

.vml-btn-redo {
	background: var(--vml-redo);
}
.vml-btn-redo:hover:not(:disabled) {
	background: var(--vml-redo-hover);
}

.vml-message {
	margin-top: 1rem;
	font-size: .9rem;
	text-align: center;
	min-height: 1.2em;
}

.vml-message--error {
	color: #c62828;
}

.vml-message--success {
	color: #2e7d32;
}

@media (max-width: 480px) {
	.vml-widget   { padding: 1.1rem; }
	.vml-counter  { font-size: 1.3rem; }
	.vml-btn      { width: 100%; justify-content: center; }
	.vml-controls,
	.vml-review-actions { flex-direction: column; }
}
