/* frontend/src/styles/auth/templates.css */
@import url('https://fonts.googleapis.com/css2?family=Iosevka+Charon+Mono&display=swap');

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  color: #203020;
  background: #edf3e7;
  font-family: 'Iosevka Charon Mono', Consolas, 'Courier New', monospace;
}

a {
  color: #2f6842;
}

button,
input {
  font: inherit;
}

.page-auth {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  width: min(100%, 420px);
}

.auth-panel,
.document-panel {
  background: #ffffff;
  border: 1px solid #d7e2d0;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(28, 48, 32, 0.12);
}

.auth-panel {
  padding: 32px;
}

.auth-panel h1,
.document-panel h1 {
  margin: 0 0 24px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.form-error {
  border: 1px solid #d98282;
  border-radius: 6px;
  color: #7d2020;
  background: #fff1f1;
  margin: 0 0 18px;
  padding: 10px 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
}

.auth-form input[type='text'],
.auth-form input[type='email'],
.auth-form input[type='password'] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #bcccb6;
  border-radius: 6px;
  padding: 10px 12px;
}

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

.password-field input[type='password'],
.password-field input[type='text'] {
  padding-right: 44px;
}

.password-field__toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  min-height: 0;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #4d5d39;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transform: translateY(-50%);
}

.password-field__toggle::before {
  display: block;
  width: 21px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50% / 58%;
  content: "";
}

.password-field__toggle::after {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.password-field__toggle.is-password-visible::before {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: url("/frontend/src/assets/images/ui/hide.png") center / contain no-repeat;
}

.password-field__toggle.is-password-visible::after {
  display: none;
}

.password-field__toggle:hover,
.password-field__toggle:focus-visible {
  color: #25341e;
  background: rgba(47, 104, 66, 0.1);
  outline: none;
}

.checkbox-field {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr;
}

.auth-turnstile {
  display: flex;
  min-height: 65px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.auth-turnstile iframe {
  max-width: 100%;
}

.auth-form button,
.game-sidebar button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: #2f6842;
  cursor: pointer;
  padding: 10px 14px;
}

.auth-form .password-field__toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  min-height: 0;
  place-items: center;
  border-radius: 999px;
  color: #4d5d39;
  background: transparent;
  padding: 0;
  transform: translateY(-50%);
}

.auth-link {
  margin: 20px 0 0;
}

.page-document {
  padding: 32px 20px;
}

.document-shell {
  width: min(100%, 820px);
  margin: 0 auto;
}

.document-panel {
  padding: 32px;
}

.document-panel h2 {
  margin: 24px 0 8px;
  font-size: 1.1rem;
}

.document-panel p {
  line-height: 1.55;
}

.document-actions {
  margin-top: 28px;
}

.page-game {
  height: 100vh;
  overflow: hidden;
}

.game-shell {
  display: grid;
  height: 100vh;
  grid-template-rows: 56px 1fr;
}

.game-topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ccd8c6;
  background: #ffffff;
  padding: 0 20px;
}

.game-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: 240px 1fr;
}

.game-sidebar {
  border-right: 1px solid #ccd8c6;
  background: #f8fbf5;
  padding: 16px;
}

.game-sidebar section {
  display: grid;
  gap: 10px;
}

.game-sidebar h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.game-viewport {
  min-width: 0;
  min-height: 0;
  background: #1f2d25;
}

.game-viewport #app {
  width: 100%;
  height: 100%;
}

@media (max-width: 720px) {
  .auth-panel,
  .document-panel {
    padding: 24px;
  }

  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .game-sidebar {
    border-top: 1px solid #ccd8c6;
    border-right: 0;
    order: 2;
  }

  .game-sidebar section {
    grid-template-columns: repeat(3, 1fr);
  }

  .game-sidebar h2 {
    display: none;
  }
}

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 4px;
  color: #8a9e85;
  font-size: 0.82rem;
}

.oauth-divider::before,
.oauth-divider::after {
  flex: 1;
  height: 1px;
  background: #d7e2d0;
  content: '';
}

.oauth-buttons {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.oauth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid #d7e2d0;
  border-radius: 6px;
  color: #203020;
  background: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  padding: 8px 16px;
  transition: background 120ms ease, border-color 120ms ease;
}

.oauth-button:hover {
  background: #f5f9f2;
  border-color: #bcccb6;
}

.oauth-button--facebook {
  color: #ffffff;
  background: #1877f2;
  border-color: #1877f2;
}

.oauth-button--facebook:hover {
  background: #166fe5;
  border-color: #166fe5;
}

.oauth-button svg {
  flex-shrink: 0;
}
