:root {
  --text: #111827;
  --muted: #6b7280;

  --card-border: rgba(255, 255, 255, 0.8);
  --card-bg-top: rgba(255, 255, 255, 0.88);
  --card-bg-bottom: rgba(255, 255, 255, 0.78);

  --field-bg: #f8f8f8;
  --field-bg-focus: #ffffff;
  --field-border: #dddddd;
  --field-border-focus: rgba(96, 165, 250, 0.55);

  --btn-1: #1f2940;
  --btn-2: #111827;

  --danger-bg: #fff1f2;
  --danger-text: #be123c;
  --danger-border: #fecdd3;

  --success-bg: #ecfdf5;
  --success-text: #047857;
  --success-border: #a7f3d0;

  --pending-bg: #00eeff;
  --pending-text: #0939f7;
  --approved-bg: #ecfdf3;
  --approved-text: #027a48;
  --approved-border: #00eeff;
  --rejected-text: #b42318;

  --shadow-card: 0 20px 45px rgba(148, 163, 184, 0.12);

  --radius-card: 28px;
  --radius-field: 12px;
  --radius-btn: 16px;

  --field-padding-x: 14px;
  --field-right-space: 46px;
  --float-left: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Work Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(201, 168, 76, 0.08), transparent 18%),
    linear-gradient(180deg, #fbfaf7 0%, #f4efe5 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 1400px;
  border: 2px solid rgba(81, 65, 65, 0.28);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::before {
  bottom: -980px;
  height: 1150px;
}

body::after {
  bottom: -860px;
  height: 980px;
  opacity: 0.55;
}

.login-box,
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  min-height: 560px;
  margin: 0 auto;
  padding: 44px 26px 40px;
  border-radius: var(--radius-card);
  background: linear-gradient(
    180deg,
    var(--card-bg-top) 0%,
    var(--card-bg-bottom) 100%
  );
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.signup-login-card.signup-watch-active {
  min-height: 400px;
  padding-top: 28px;
  padding-bottom: 22px;
}

.signup-login-card {
  min-height: 500px;
}

.signup-login-card.signup-watch-active {
  min-height: 400px;
  padding-top: 34px;
  padding-bottom: 28px;
}

.signup-login-card.signup-watch-active .status-watch {
  padding-top: 0;
}

.signup-login-card.signup-watch-active .watch-pulse-wrap {
  margin: 4px auto 20px;
}

.signup-login-card.signup-watch-active .watch-title {
  margin: 0 0 10px;
}

.signup-login-card.signup-watch-active .watch-sub {
  margin: 0 0 8px;
}

.signup-login-card.signup-watch-active .watch-email {
  margin-bottom: 18px;
}

.signup-login-card.signup-watch-active .watch-dots {
  margin-bottom: 18px;
}

.signup-login-card.signup-watch-active .watch-result {
  margin-bottom: 12px;
}

.signup-login-card.signup-watch-active .watch-redirect-bar {
  margin-bottom: 14px;
}

.signup-login-card.signup-watch-active .watch-login-btn,
.signup-login-card.signup-watch-active .watch-retry-btn {
  margin-bottom: 10px;
}

.signup-login-card.signup-watch-active .signup-subtext {
  margin-top: 18px;
  padding-top: 0;
}
.admin-login-card {
  min-height: 500px;
  padding-top: 36px;
  padding-bottom: 32px;
}

.login-box form,
.login-card,
.login-card > form.auth-form,
.status-watch {
  display: flex;
  flex-direction: column;
}

.login-card > form.auth-form,
.status-watch {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.login-card > form.auth-form {
  gap: 0;
}

.auth-icon {
  width: 66px;
  height: 66px;
  margin: 0 auto 28px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f4f6fa 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 22px rgba(148, 163, 184, 0.12);
}

.auth-icon svg {
  width: 30px;
  height: 30px;
  color: #303746;
}

.login-box h2,
.login-card h1 {
  margin: 0 0 14px;
  text-align: center;
  font-size: 1.95rem;
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.login-box h2 + p,
.login-card h1 + p {
  margin: 0 auto 8px;
  max-width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  font-weight: 500;
}

.field-group,
.password-field {
  position: relative;
  width: 100%;
  margin-top: 24px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  height: 46px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-field);
  outline: none;
  background-color: var(--field-bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.2;
  padding: 16px var(--field-right-space) 10px var(--field-padding-x);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

input::placeholder {
  color: transparent;
}

.field-group label {
  position: absolute;
  top: 50%;
  left: var(--field-padding-x);
  transform: translateY(-50%);
  padding: 0 6px;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1;
  color: #6b7280;
  background: transparent;
  transition: all 0.2s ease;
  z-index: 2;
  cursor: text;
}

.field-group input:focus {
  background: var(--field-bg-focus);
  border-color: var(--field-border-focus);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1);
}

.field-group input:focus + label,
.field-group input:not(:placeholder-shown) + label,
.field-group input:-webkit-autofill + label {
  top: 0;
  left: var(--float-left);
  transform: translateY(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  color: #374151;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 999px;
}

input[type="email"],
input[name="employee_id"] {
  padding-left: var(--field-padding-x);
}

.password-field input[type="password"],
.password-field input[type="text"] {
  padding-right: 46px;
  padding-left: var(--field-padding-x);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: transparent;
  display: grid;
  place-items: center;
  color: #8b93a1;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 3;
}

.password-toggle:hover {
  background: rgba(15, 23, 42, 0.05);
  color: #4b5563;
}

.password-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.14);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.icon-eye-off {
  display: none;
}

input[type="submit"],
.login-card > button[type="submit"],
.login-card form button[type="submit"] {
  width: 100%;
  min-height: 48px;
  margin-top: 30px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-btn);
  background: linear-gradient(180deg, var(--btn-1) 0%, var(--btn-2) 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 22px rgba(15, 23, 42, 0.16);
  transition: transform 0.2s ease, filter 0.2s ease;
}

input[type="submit"]:hover,
.login-card > button[type="submit"]:hover,
.login-card form button[type="submit"]:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.error,
.error-message,
.success-message {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  font-weight: 600;
}

.error,
.error-message {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

.success-message {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.signup-subtext {
  margin: 28px 0 0;
  padding-top: 8px;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--muted);
}

.signup-subtext a,
.form-link,
.forgot-row a {
  color: #374151;
  text-decoration: none;
  font-weight: 700;
}

.signup-subtext a:hover,
.form-link:hover,
.forgot-row a:hover {
  text-decoration: underline;
}

.forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  margin-bottom: 0;
}

.status-watch {
  display: none;
  align-items: center;
  text-align: center;
  padding-top: 6px;
  width: 100%;
  max-width: 100%;
}

.status-watch.visible {
  display: flex;
}

.watch-pulse-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 6px auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.watch-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  animation: pulseRing 2s ease-out infinite;
}

.watch-pulse-ring:nth-child(2) {
  animation-delay: 0.66s;
}

.watch-pulse-ring:nth-child(3) {
  animation-delay: 1.32s;
}

@keyframes pulseRing {
  0%   { transform: scale(0.55); opacity: 0.8; }
  100% { transform: scale(1.45); opacity: 0; }
}

.watch-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  position: relative;
  z-index: 1;
  transition: background 0.4s, color 0.4s;
}

.status-watch.pending .watch-pulse-ring {
  color: var(--pending-text);
}

.status-watch.pending .watch-icon {
  background: var(--pending-bg);
  color: var(--pending-text);
}

.status-watch.approved .watch-pulse-ring,
.status-watch.rejected .watch-pulse-ring {
  animation: none;
  opacity: 0;
}

.status-watch.approved .watch-icon {
  background: var(--approved-bg);
  color: var(--approved-text);
}

.status-watch.rejected .watch-icon {
  background: #fef3f2;
  color: var(--rejected-text);
}

.watch-title {
  font-size: 20px;
  font-weight: 800;
  color: #101828;
  margin: 0 0 12px;
}

.watch-sub {
  font-size: 13px;
  color: #667085;
  line-height: 1.5;
  margin: 0 0 10px;
  max-width: 100%;
  white-space: nowrap;
}

.watch-email {
  font-size: 13px;
  font-weight: 700;
  color: #344054;
  word-break: break-all;
  margin-bottom: 24px;
}

.watch-dots {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 24px;
}

.watch-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pending-text);
  animation: dotBounce 1.2s ease-in-out infinite;
}

.watch-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.watch-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-6px); opacity: 1; }
}

.status-watch:not(.pending) .watch-dots {
  display: none;
}

.watch-result {
  display: none;
  width: 100%;
  padding: 0;
  margin: 0 0 16px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.status-watch.approved .watch-result,
.status-watch.rejected .watch-result {
  display: block;
  background: transparent;
  border: none;
}

.status-watch.approved .watch-result {
  color: var(--approved-text);
}

.status-watch.rejected .watch-result {
  color: var(--rejected-text);
}

.watch-redirect-bar {
  display: none;
  width: 100%;
  margin-bottom: 18px;
}

.status-watch.approved .watch-redirect-bar {
  display: block;
}

.watch-redirect-text {
  font-size: 12px;
  color: #667085;
  margin-bottom: 6px;
  text-align: center;
}

.watch-redirect-progress {
  height: 4px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
}

.watch-redirect-fill {
  height: 100%;
  background: var(--approved-text);
  border-radius: 99px;
  width: 100%;
  transition: width 1s linear;
}

.watch-login-btn {
  display: none;
  width: 100%;
  height: 44px;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.watch-login-btn:hover {
  background: #0b1220;
}

.status-watch.approved .watch-login-btn {
  display: flex;
}

.watch-retry-btn {
  display: none;
  background: none;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  color: #344054;
  cursor: pointer;
  margin-bottom: 14px;
}

.watch-retry-btn:hover {
  background: #f2f4f7;
}

.status-watch.rejected .watch-retry-btn {
  display: inline-block;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--field-bg) inset;
  transition: background-color 9999s ease-in-out 0s;
}

input:-webkit-autofill:focus {
  -webkit-box-shadow:
    0 0 0 1000px var(--field-bg-focus) inset,
    0 0 0 4px rgba(96, 165, 250, 0.1);
}

@media (max-width: 520px) {
  body {
    padding: 14px;
  }

  .login-box,
  .login-card {
    max-width: 100%;
    min-height: 600px;
    padding: 36px 18px 30px;
    border-radius: 22px;
  }

  .admin-login-card {
    min-height: 520px;
    padding-top: 30px;
    padding-bottom: 26px;
  }

  .auth-icon {
    width: 62px;
    height: 62px;
    margin-bottom: 24px;
  }

  .login-box h2,
  .login-card h1 {
    font-size: 1.75rem;
    margin-bottom: 12px;
  }

  .login-box h2 + p,
  .login-card h1 + p,
  .signup-subtext {
    max-width: 100%;
    font-size: 0.94rem;
  }

  .field-group,
  .password-field {
    margin-top: 20px;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"] {
    height: 46px;
    font-size: 0.95rem;
  }

  .signup-subtext {
    margin-top: 24px;
    line-height: 1.75;
  }

  .watch-sub {
    white-space: normal;
  }
}