:root {
  --bg: #6b1420;
  --card: #ffffff;
  --accent: #e10600;
  --text: #111111;
  --gap: 12px;
  --radius: 24px;
  --pad-x: 26px;
  --pad-y: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 416px;
  height: 624px;
  max-width: 416px;
  max-height: 624px;
  overflow: hidden;
  background: var(--bg);
  font-family: "Manrope", sans-serif;
  color: var(--text);
}

body {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.widget {
  width: 416px;
  height: 624px;
  padding: 14px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.card {
  flex: 1 1 0;
  min-height: 0;
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--pad-y) var(--pad-x);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
  animation: rise 0.55s ease both;
}

.card:nth-child(2) {
  animation-delay: 0.08s;
}

.card:nth-child(3) {
  animation-delay: 0.16s;
}

.type {
  color: var(--accent);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.rule {
  display: block;
  width: 26px;
  height: 2px;
  margin: 12px 0 10px;
  background: #111;
}

.price {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-weight: 800;
  line-height: 1;
}

.value-input {
  width: 100%;
  max-width: 220px;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  padding: 0;
  border-bottom: 2px solid transparent;
}

.value-input:focus {
  border-bottom-color: var(--accent);
}

.price .currency {
  font-size: 28px;
  margin-top: 8px;
  font-weight: 700;
  flex-shrink: 0;
}

.footer-bar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.datetime {
  text-align: center;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.25;
  white-space: nowrap;
}

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

.save-btn {
  border: none;
  border-radius: 999px;
  background: #ffffff;
  color: var(--bg);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 8px 18px;
  cursor: pointer;
}

.save-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.logout-link {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.save-msg {
  font-size: 13px;
  font-weight: 700;
  min-height: 16px;
}

.save-msg.is-ok {
  color: #b7f5c4;
}

.save-msg.is-err {
  color: #ffb4b4;
}

.login-widget {
  justify-content: center;
}

.login-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.login-title {
  color: var(--accent);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.login-label {
  font-size: 13px;
  font-weight: 700;
  color: #444;
}

.login-input {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  outline: none;
}

.login-input:focus {
  border-color: var(--accent);
}

.login-btn {
  margin-top: 10px;
  border: none;
  border-radius: 14px;
  background: var(--bg);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  padding: 14px;
  cursor: pointer;
}

.login-error {
  background: #ffe5e5;
  color: #b00000;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

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