/* Generic Dashboard — authentication UI
 * Standalone stylesheet: auth pages must not depend on Tailwind utilities.
 */

:root {
  --auth-bg: #eef3fa;
  --auth-card: rgba(255, 255, 255, 0.94);
  --auth-border: rgba(34, 48, 84, 0.12);
  --auth-text: #172033;
  --auth-muted: #667085;
  --auth-primary: #01bfc0;
  --auth-secondary: #6d5dfc;
  --auth-input: #ffffff;
  --auth-focus: rgba(1, 191, 192, 0.16);
  --auth-shadow: rgba(20, 32, 60, 0.16);
}

:root[data-theme="dark"] {
  --auth-bg: #060a16;
  --auth-card: rgba(8, 14, 31, 0.96);
  --auth-border: rgba(164, 208, 254, 0.18);
  --auth-text: #edf6ff;
  --auth-muted: #9aa8bd;
  --auth-primary: #01bfc0;
  --auth-secondary: #6d5dfc;
  --auth-input: #0b1325;
  --auth-focus: rgba(1, 191, 192, 0.18);
  --auth-shadow: rgba(0, 0, 0, 0.34);
}

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

html {
  background: var(--auth-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--auth-text);
  background: var(--auth-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-layout {
  min-height: 100vh;
  width: 100%;
}

.auth-page {
  min-height: 100vh;
  width: 100%;
  box-sizing: border-box;
  padding: 32px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(1, 191, 192, 0.13), transparent 34%),
    radial-gradient(circle at 86% 16%, rgba(109, 93, 252, 0.16), transparent 36%),
    linear-gradient(135deg, #eef3fa 0%, #f5f7fc 52%, #eef1ff 100%);
}

:root[data-theme="dark"] .auth-page {
  background:
    radial-gradient(circle at 14% 24%, rgba(1, 191, 192, 0.14), transparent 34%),
    radial-gradient(circle at 87% 16%, rgba(109, 93, 252, 0.18), transparent 38%),
    linear-gradient(135deg, #071522 0%, #070b18 48%, #10102a 100%);
}

.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 90%);
}

.auth-container {
  width: min(100%, 560px);
  position: relative;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--auth-text);
  font-size: 24px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.auth-brand-logo,
.gd-logo,
.auth-logo {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  display: block;
  flex: 0 0 56px;
  object-fit: contain;
  border-radius: 12px;
  box-sizing: border-box;
}

.auth-card {
  width: 100%;
  box-sizing: border-box;
  padding: 40px;
  border: 1px solid var(--auth-border);
  border-radius: 24px;
  background: var(--auth-card);
  box-shadow: 0 30px 80px var(--auth-shadow);
}

.auth-title {
  margin: 0;
  color: var(--auth-text);
  font-size: clamp(32px, 5vw, 40px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.auth-subtitle {
  margin: 10px 0 30px;
  color: var(--auth-muted);
  font-size: 18px;
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 20px;
}

.auth-field {
  width: 100%;
}

.auth-field > label {
  display: block;
  margin: 0 0 10px;
  color: var(--auth-text);
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
}

.auth-field input,
.auth-otp input,
.otp-input {
  display: block;
  width: 100%;
  min-height: 52px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  outline: none;
  color: var(--auth-text);
  background: var(--auth-input);
  font: inherit;
  font-size: 16px;
  line-height: 1.2;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-field input::placeholder,
.auth-otp input::placeholder,
.otp-input::placeholder {
  color: var(--auth-muted);
  opacity: 0.9;
}

.auth-field input:focus,
.auth-otp input:focus,
.otp-input:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 4px var(--auth-focus);
}

.auth-password-wrap {
  position: relative;
  width: 100%;
}

.auth-password-wrap .auth-password-input {
  padding-right: 58px;
}

.auth-password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 54px;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0 13px 13px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
  font: inherit;
}

.auth-password-toggle:hover {
  color: var(--auth-text);
  background: rgba(1, 191, 192, 0.07);
}

.auth-password-toggle:focus-visible {
  outline: 2px solid var(--auth-primary);
  outline-offset: -3px;
}

.auth-password-toggle svg {
  width: 23px;
  height: 23px;
  display: block;
  pointer-events: none;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 24px;
  margin-top: -2px;
}

.auth-remember input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  border: 1px solid var(--auth-border);
  border-radius: 5px;
  background: var(--auth-input);
  display: grid;
  place-content: center;
  cursor: pointer;
}

.auth-remember input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  border-radius: 2px;
  background: var(--auth-primary);
  transition: transform 120ms ease;
}

.auth-remember input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.auth-remember label {
  margin: 0;
  color: var(--auth-text);
  font-size: 16px;
  line-height: 1.3;
  font-weight: 600;
  cursor: pointer;
}

.auth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 60px;
  margin: 2px 0 0;
  padding: 0 22px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
  box-shadow: 0 14px 30px rgba(1, 191, 192, 0.18);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.auth-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 18px 36px rgba(1, 191, 192, 0.22);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-links {
  margin-top: 22px;
  color: var(--auth-muted);
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
}

.auth-links a {
  color: var(--auth-secondary);
  font-weight: 700;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-divider {
  height: 1px;
  margin: 38px 0 26px;
  background: var(--auth-border);
}

/* Devise errors / notices */
.auth-card .alert,
.auth-card .notice,
.auth-error,
.auth-errors {
  margin: 0 0 22px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}

.auth-card .alert,
.auth-error,
.auth-errors {
  color: #ffd5da;
  background: rgba(190, 42, 61, 0.15);
  border: 1px solid rgba(255, 110, 128, 0.22);
}

.auth-card .notice {
  color: #c9fff1;
  background: rgba(1, 191, 192, 0.10);
  border: 1px solid rgba(1, 191, 192, 0.20);
}

/* OTP / secondary Devise screens */
.auth-otp {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-otp label {
  color: var(--auth-text);
  font-weight: 700;
}

@media (max-width: 720px) {
  .auth-page {
    padding: 32px 16px;
  }

  .auth-container {
    width: min(100%, 560px);
  }

  .auth-brand {
    font-size: 24px;
  }

  .auth-brand-logo,
  .gd-logo,
  .auth-logo {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    flex-basis: 60px;
    border-radius: 15px;
  }

  .auth-card {
    padding: 36px 28px;
    border-radius: 24px;
  }

  .auth-title {
    font-size: 36px;
  }

  .auth-subtitle {
    font-size: 18px;
    margin-bottom: 32px;
  }
}

@media (max-width: 480px) {
  .auth-page {
    padding: 22px 12px;
    align-items: flex-start;
  }

  .auth-container {
    margin-top: 12px;
  }

  .auth-brand {
    gap: 10px;
    margin-bottom: 20px;
    font-size: 18px;
  }

  .auth-brand-logo,
  .gd-logo,
  .auth-logo {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    flex-basis: 50px;
    border-radius: 13px;
  }

  .auth-card {
    padding: 30px 20px;
    border-radius: 20px;
  }

  .auth-title {
    font-size: 32px;
  }

  .auth-form {
    gap: 22px;
  }
}
