:root {
  --yd-bg: #e8efe8;
  --yd-paper: #f7f4ec;
  --yd-ink: #14241e;
  --yd-muted: #5d6d66;
  --yd-line: rgba(20, 36, 30, 0.12);
  --yd-copper: #b86a2c;
  --yd-sage: #2f6b52;
  --yd-out: #b23a3a;
  --yd-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --yd-safe-top: env(safe-area-inset-top, 0px);
  --yd-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ylp-hero-max: clamp(180px, 32vh, 260px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body.ylp-auth {
  min-height: 100dvh;
  font-family: Outfit, system-ui, sans-serif;
  color: var(--yd-ink);
  background:
    radial-gradient(90% 40% at 100% -10%, rgba(184, 106, 44, 0.18), transparent 55%),
    linear-gradient(180deg, #d7e4d8 0%, var(--yd-bg) 38%);
}

.ylp-frame {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: calc(12px + var(--yd-safe-top)) 18px calc(24px + var(--yd-safe-bottom));
}

.ylp-auth-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ylp-auth-top img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

.ylp-auth-top__name {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.ylp-auth-top__tag {
  margin: 4px 0 0;
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--yd-muted);
}

.ylp-hero {
  flex-shrink: 0;
  margin-bottom: 14px;
  border: 1px solid var(--yd-line);
  overflow: hidden;
  line-height: 0;
  background: var(--yd-paper);
}

.ylp-hero img {
  width: 100%;
  height: auto;
  max-height: var(--ylp-hero-max);
  object-fit: cover;
  object-position: center top;
  display: block;
}

.ylp-sheet {
  flex: 1;
  padding: 18px 16px 20px;
  background: var(--yd-paper);
  border: 1px solid var(--yd-line);
}

.ylp-title {
  margin: 0 0 6px;
  font-family: Fraunces, Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--yd-ink);
  line-height: 1.1;
}

.ylp-lead {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.5;
  color: var(--yd-muted);
  max-width: 300px;
}

.ylp-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.4;
  color: var(--yd-out);
  background: rgba(178, 58, 58, 0.08);
  border: 1px solid rgba(178, 58, 58, 0.22);
}

.ylp-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ylp-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  background: rgba(20, 36, 30, 0.04);
  border: 1px solid var(--yd-line);
  transition: border-color 0.15s var(--yd-ease);
}

.ylp-field:focus-within {
  border-color: rgba(47, 107, 82, 0.45);
}

.ylp-ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  color: var(--yd-copper);
}

.ylp-prefix {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--yd-ink);
  padding-right: 10px;
  border-right: 1px solid var(--yd-line);
  line-height: 1;
}

.ylp-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 550;
  color: var(--yd-ink);
  padding: 12px 0;
}

.ylp-field input::placeholder {
  color: var(--yd-muted);
  font-weight: 550;
}

.ylp-eye {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--yd-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.ylp-eye svg { width: 20px; height: 20px; }
.ylp-eye .ylp-eye-off { display: none; }
.ylp-eye.is-on .ylp-eye-on { display: none; }
.ylp-eye.is-on .ylp-eye-off { display: block; }

.ylp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  min-height: 48px;
  border: 0;
  font-family: Outfit, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 650;
  color: #f7f4ec;
  cursor: pointer;
  background: var(--yd-ink);
  transition: transform 0.12s var(--yd-ease), opacity 0.12s var(--yd-ease);
}

.ylp-btn svg { width: 18px; height: 18px; }
.ylp-btn:active { transform: scale(0.98); }
.ylp-btn:disabled { opacity: 0.65; cursor: wait; }

.ylp-switch {
  display: block;
  text-align: center;
  margin: 16px 0 0;
  font-size: 13px;
  font-weight: 550;
  color: var(--yd-muted);
}

.ylp-switch a {
  color: var(--yd-sage);
  font-weight: 650;
  text-decoration: none;
}

.ylp-switch a:active { opacity: 0.75; }

.ylp-auth--register {
  --ylp-hero-max: clamp(140px, 24vh, 200px);
}

.ylp-auth--register .ylp-title { font-size: 26px; }
.ylp-auth--register .ylp-lead { margin-bottom: 14px; }
.ylp-auth--register .ylp-form { gap: 10px; }

@media (max-height: 740px) {
  body.ylp-auth { --ylp-hero-max: 165px; }
  .ylp-auth--register { --ylp-hero-max: 130px; }
  .ylp-title { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .ylp-btn, .ylp-field { transition: none; }
}
