/**
 * Animal-Island inspired tokens & components
 * Visual reference: https://github.com/guokaigdg/animal-island-vue
 * (reimplemented CSS for Chichiachiu PHP login — not a Vue package copy)
 */

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

:root {
  --ai-primary: #19c8b9;
  --ai-primary-hover: #3dd4c6;
  --ai-primary-active: #50b9ab;
  --ai-primary-bg: #e6f9f6;

  --ai-text: #794f27;
  --ai-text-body: #725d42;
  --ai-text-secondary: #9f927d;
  --ai-text-disabled: #c4b89e;

  --ai-border: #aaa69d;
  --ai-border-hover: #827157;

  --ai-bg: #f8f8f0;
  --ai-bg-secondary: #f0e8d8;
  --ai-bg-input: #fffbe7;
  --ai-card: rgb(247, 243, 223);

  --ai-cream: #f8f8f0;
  --ai-warm: #794f27;
  --ai-shadow-warm: #bdaea0;
  --ai-shadow-soft: #d4c9b4;

  --ai-error: #e05a5a;
  --ai-error-active: #c94444;
  --ai-success: #6fba2c;

  --ai-demo-green: #7dc395;

  --ai-font: Nunito, "Noto Sans SC", "Zen Maru Gothic", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ai-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Primary game button (animal-btn--primary) ---- */
.ai-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 45px;
  padding: 0 20px;
  border: 2px solid transparent;
  border-radius: 50px;
  font-family: var(--ai-font);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  outline: none;
  text-decoration: none;
  transition: all 0.25s var(--ai-ease);
}

.ai-btn:focus-visible {
  outline: 2px solid var(--ai-primary);
  outline-offset: 2px;
}

.ai-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.ai-btn--primary {
  color: var(--ai-warm);
  background: var(--ai-cream);
  border-color: var(--ai-cream);
  box-shadow: 0 5px 0 0 var(--ai-shadow-warm);
}

.ai-btn--primary:hover:not(:disabled) {
  text-decoration: none;
  color: var(--ai-warm);
  transform: translateY(-1px);
  box-shadow: 0 6px 0 0 var(--ai-shadow-warm);
}

.ai-btn--primary:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 0 var(--ai-shadow-warm);
}

.ai-btn--default {
  color: var(--ai-text);
  background: var(--ai-bg);
  border-color: var(--ai-border);
  box-shadow: 0 2px 4px 0 rgba(61, 52, 40, 0.06);
}

.ai-btn--default:hover:not(:disabled) {
  text-decoration: none;
  color: var(--ai-primary);
  border-color: var(--ai-primary);
  box-shadow: 0 3px 10px 0 rgba(61, 52, 40, 0.1);
  transform: translateY(-1px);
}

.ai-btn--default:active:not(:disabled) {
  color: var(--ai-primary-active);
  border-color: var(--ai-primary-active);
  transform: translateY(0);
  box-shadow: 0 2px 4px 0 rgba(61, 52, 40, 0.06);
}

.ai-btn--block {
  display: flex;
  width: 100%;
}

.ai-btn--large {
  height: 48px;
  padding: 0 32px;
  font-size: 16px;
  border-radius: 24px;
}

/* ---- Capsule input (animal-input) ---- */
.ai-input {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 18px;
  background: var(--ai-bg-input);
  border: none;
  border-radius: 50px;
  box-shadow: 0 3px 0 0 var(--ai-shadow-soft);
  transition: all 0.25s var(--ai-ease);
}

.ai-input:focus-within {
  box-shadow: 0 3px 0 0 var(--ai-primary);
}

.ai-input.is-error {
  box-shadow: 0 3px 0 0 var(--ai-error-active);
}

.ai-input input {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #725d42;
  font-family: var(--ai-font);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  line-height: 1.5715;
}

.ai-input input::placeholder {
  color: var(--ai-text-disabled);
  font-weight: 400;
}

/* ---- Login page shell ---- */
.page-login-ai {
  min-height: 100vh;
  margin: 0;
  font-family: var(--ai-font);
  color: var(--ai-text-body);
  background-color: var(--ai-demo-green);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.28) 0 18%, transparent 19%),
    radial-gradient(circle at 88% 12%, rgba(255, 251, 231, 0.35) 0 12%, transparent 13%),
    radial-gradient(circle at 70% 78%, rgba(121, 79, 39, 0.08) 0 22%, transparent 23%),
    linear-gradient(180deg, #8ecfa5 0%, #7dc395 45%, #6bb584 100%);
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.page-login-ai a {
  color: var(--ai-primary);
  text-decoration: none;
  font-weight: 600;
}

.page-login-ai a:hover {
  color: var(--ai-primary-hover);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.ai-login {
  width: min(100%, 400px);
  max-width: 100%;
  padding: 28px 28px 24px;
  border-radius: 20px;
  border: 1.5px solid #d4c4a8;
  color: #725d42;
  overflow: hidden;
  background:
    radial-gradient(circle, rgba(196, 184, 158, 0.15) 1.5px, transparent 1.5px),
    radial-gradient(circle, rgba(196, 184, 158, 0.1) 1px, transparent 1px),
    rgb(247, 243, 223);
  background-size: 28px 28px, 14px 14px;
  background-position: 0 0, 7px 7px;
  animation: ai-pop 0.55s var(--ai-ease) both;
}

.ai-login form {
  width: 100%;
  max-width: 100%;
}

.ai-login__field {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ai-text-secondary);
  letter-spacing: 0.02em;
}

.ai-login__field .ai-input {
  margin-top: 8px;
  width: 100%;
  max-width: 100%;
}

.ai-login__actions {
  margin-top: 18px;
  width: 100%;
  max-width: 100%;
}

.ai-login__actions .ai-btn {
  width: 100%;
  max-width: 100%;
}

@keyframes ai-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ai-login__brand {
  display: block;
  margin: 0 0 6px;
  font-family: var(--ai-font);
  font-weight: 900;
  font-size: 1.75rem;
  letter-spacing: 0.02em;
  color: var(--ai-text);
  text-decoration: none;
  text-align: center;
}

.ai-login__brand:hover {
  color: var(--ai-primary);
  text-decoration: none;
}

.ai-login__title {
  margin: 0 0 1.15rem;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ai-text);
  letter-spacing: 0.04em;
}

.ai-login__msg {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  background: #ffe8e8;
  color: var(--ai-error);
  border: 1.5px solid #fc736d;
}

.ai-login__foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ai-text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .ai-login {
    animation: none;
  }
  .ai-btn--primary:hover:not(:disabled),
  .ai-btn--primary:active:not(:disabled) {
    transform: none;
  }
}
