* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #111111;
  background: #ffffff;
}

.signin-wrap {
  width: min(480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 8px 10px;
  display: grid;
  gap: 14px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8e8e8e;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  width: fit-content;
}

.back-link:hover {
  color: #2b2b2b;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #111111;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 15px;
  flex-shrink: 0;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 3px 0 0;
  color: #8a8a8a;
  font-size: 14px;
  line-height: 1.3;
}

.info-text {
  margin: 4px 0 0;
  color: #6e6e6e;
  font-size: 13px;
  line-height: 1.4;
  padding: 10px 12px;
  border: 1px solid #ececec;
  border-radius: 12px;
  background: #fafafa;
}

.signin-form {
  margin-top: 0;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #626262;
}

.phrase-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ececec;
  border-radius: 14px;
  resize: none;
  min-height: 110px;
  max-height: 110px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  background: #ffffff;
}

.phrase-input::placeholder {
  color: #a0a0a0;
}

.phrase-input:focus {
  outline: none;
  border-color: #c5c5c5;
}

.signin-form.is-error .phrase-input {
  border-color: #ef4444;
}

.signin-form.is-error .phrase-input:focus {
  border-color: #ef4444;
}

.signin-alert {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
}

.word-count {
  margin: 8px 0 16px;
  color: #7e7e7e;
  font-size: 13px;
  transition: color 0.15s ease, font-weight 0.15s ease;
}

.word-count.is-complete {
  color: #111111;
  font-weight: 600;
}

.error-text {
  margin: -8px 0 12px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
}

.btn-dark {
  width: 100%;
  margin-top: 30px;
  border-radius: 999px;
  height: 46px;
  border: 1px solid #111111;
  background: #111111;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}

.btn-dark:hover {
  background: #000000;
  transform: translateY(-1px);
}

.phrase-input:disabled {
  background: #ffffff;
  color: #111111;
  border-color: #ececec;
  cursor: text;
  opacity: 1;
}

.btn-dark:disabled {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
  cursor: pointer;
  transform: none;
  opacity: 1;
}

.btn-dark:disabled:hover {
  background: #000000;
}

@media (max-width: 560px) {
  body {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
  }

  .signin-wrap {
    width: calc(100% - 24px);
    margin: 0 auto;
    padding: 8px 0 4px;
  }
}
