/*
  Input 07 — Auto-Grow Textarea — standalone HTML/CSS/JS implementation.
  No build step, no framework, no external dependency: copy index.html,
  this file, and script.js into any project as-is.
*/

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

:root {
  --input-accent: #39ff14;
  --input-fg: oklch(0.145 0 0);
  --input-border: oklch(0.87 0 0);
  --input-border-hover: oklch(0.72 0 0);
  --input-muted: oklch(0.5 0 0);
  --input-warning: oklch(0.68 0.14 75);
  --input-error: oklch(0.58 0.19 20);
}

.grow-field {
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

.grow-field__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.375rem;
}

.grow-field__label {
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--input-fg);
}

.grow-field__counter {
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  color: var(--input-muted);
}

.grow-field__counter--warning {
  color: var(--input-warning);
}

.grow-field__counter--error {
  color: var(--input-error);
}

.grow-field__control {
  display: block;
  width: 100%;
  resize: none;
  overflow-y: hidden;
  border-radius: 0.5rem;
  border: 1px solid var(--input-border);
  background-color: #ffffff;
  padding: 0.75rem 0.875rem;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5rem;
  color: var(--input-fg);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, height 120ms ease;
}

.grow-field__control:hover {
  border-color: var(--input-border-hover);
}

.grow-field__control:focus-visible {
  border-color: var(--input-fg);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--input-accent) 40%, transparent);
}

.grow-field__message {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  color: var(--input-muted);
}

@media (prefers-reduced-motion: reduce) {
  .grow-field__control {
    transition: border-color 150ms ease, box-shadow 150ms ease;
  }
}

/*
  Page layout — the canvas this resource is presented on. Adjust or drop it
  when placing the resource inside your own layout.
*/

body {
  margin: 0;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, #fafafa, #f4f4f5);
}
.input07-layout {
  display: flex;
  min-height: 20rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.input07-layout__panel {
  width: 100%;
  max-width: 480px;
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 16px 40px -16px rgba(0, 0, 0, 0.14);
}
