:root {
  --bg: #ebe2d0;
  --card: rgba(255, 251, 242, 0.9);
  --ink: #1e271f;
  --muted: #5f6a60;
  --accent: #17412b;
  --accent-2: #2f8f58;
  --danger: #b8452c;
  --line: rgba(23, 65, 43, 0.12);
  --shadow: 0 18px 60px rgba(40, 29, 8, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 30%),
    linear-gradient(160deg, #f6efd9 0%, #e9decb 42%, #d9c7a7 100%);
}

.shell {
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.card {
  background: var(--card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% 35%;
  height: 180px;
  background: radial-gradient(circle, rgba(47, 143, 88, 0.24), transparent 70%);
  pointer-events: none;
}

.badge {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(23, 65, 43, 0.08);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 16px;
  font-size: 32px;
  line-height: 1;
}

h2 {
  margin-bottom: 18px;
  font-size: 24px;
}

.subtitle,
.muted,
.status {
  color: var(--muted);
}

.control-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gear {
  width: 36px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.settings {
  display: grid;
  gap: 12px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f5f8f5;
}

.settings input {
  max-width: 130px;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  padding-right: 92px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  padding: 7px 9px;
  background: #e8f0ea;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.subtitle {
  margin-top: 10px;
  font-size: 15px;
}

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

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  border: 1px solid rgba(23, 65, 43, 0.18);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.9);
}

input:focus,
button:focus {
  outline: 3px solid rgba(47, 143, 88, 0.22);
  outline-offset: 2px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

button {
  cursor: pointer;
  border: 0;
}

.primary,
.ghost,
.gate-button {
  border-radius: 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary {
  padding: 15px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 16px 34px rgba(23, 65, 43, 0.28);
}

.ghost {
  background: rgba(23, 65, 43, 0.08);
  color: var(--accent);
  padding: 10px 14px;
  font-weight: 700;
}

.ghost.small {
  font-size: 14px;
}

.control-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.gate-button {
  width: 100%;
  min-height: 210px;
  margin: 18px 0 12px;
  padding: 24px;
  color: white;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.32), transparent 34%),
    linear-gradient(180deg, #2fa161 0%, #17412b 100%);
  box-shadow: 0 24px 44px rgba(17, 54, 35, 0.34);
}

.gate-button:active {
  transform: scale(0.985);
}

.gate-label {
  display: block;
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
}

.gate-subtitle {
  display: block;
  margin-top: 10px;
  font-size: 16px;
  opacity: 0.92;
}

.gate-button.busy {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(180deg, #7f8d85 0%, #56635b 100%);
}

.gate-button.error {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(180deg, #da6f4f 0%, var(--danger) 100%);
}

.status {
  min-height: 24px;
  text-align: center;
  padding: 4px 12px;
  font-weight: 600;
}

.status.ok {
  color: var(--accent);
}

.status.error {
  color: var(--danger);
}

.center {
  text-align: center;
}

.hidden {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .card {
    animation: rise 360ms ease both;
  }

  .card:nth-of-type(2) {
    animation-delay: 70ms;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(12px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
