:root {
  --auth-bg: #F8FAFC;
  --auth-card: #ffffff;
  --auth-green: var(--primary, #E8505B);
  --auth-green-dark: var(--primary-dark, #D63B46);
  --auth-text: #1E293B;
  --auth-muted: #64748B;
  --auth-border: rgba(30, 41, 59, 0.08);
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.nav-back:hover {
  opacity: 0.85;
}

.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.25rem 2.5rem;
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 80, 91, 0.12) 0%, transparent 70%);
  top: -10%;
  right: -5%;
}

.auth-page::after {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 92, 0.08) 0%, transparent 70%);
  bottom: 5%;
  left: 5%;
}

.auth-shell {
  width: 100%;
  max-width: 1024px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  position: relative;
  z-index: 2;
}

.auth-brand {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand-logo {
  max-width: 200px;
  width: 100%;
}

.auth-brand h1 {
  font-size: 2.2rem;
  color: #fff;
  margin-top: 1.25rem;
  font-weight: 800;
}

.auth-brand p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.05rem;
  margin-top: 1rem;
  line-height: 1.7;
}

.auth-badges {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.auth-badge {
  background: rgba(232, 80, 91, 0.12);
  color: #FF8A5C;
  border: 1px solid rgba(232, 80, 91, 0.2);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Modern Card Design */
.auth-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 32px;
  padding: 2.5rem;
  box-shadow:
    0 20px 40px -10px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  backdrop-filter: blur(20px);
}

.auth-card h2 {
  font-size: 1.75rem;
  color: #0F172A;
  margin-bottom: 0.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Modern Alerts */
.auth-error {
  background: #FEF2F2;
  color: #991B1B;
  padding: 1rem;
  border-radius: 16px;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  border: 1px solid #FECACA;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-success {
  background: #F0FDF4;
  color: #166534;
  padding: 1rem;
  border-radius: 16px;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  border: 1px solid #86EFAC;
}

/* Redesigned Role Selector */
.auth-roles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background: #F1F5F9;
  padding: 0.5rem;
  border-radius: 20px;
}

.auth-role {
  border: 2px solid transparent;
  background: transparent;
  border-radius: 16px;
  padding: 0.75rem 0.25rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
}

.auth-role strong {
  display: block;
  font-size: 0.9rem;
  color: #64748B;
  font-weight: 600;
  transition: color 0.2s;
}

.auth-role span {
  display: none;
  /* Simplify the look */
}

.auth-role:hover strong {
  color: #1E293B;
}

.auth-role.active {
  background: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.auth-role.active strong {
  color: #E8505B;
  font-weight: 700;
}

/* Inputs */
.auth-form .form-group {
  margin-bottom: 1.25rem;
}

.auth-form .form-group label {
  display: block;
  font-size: 0.875rem;
  color: #64748B;
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-left: 4px;
}

.auth-form .form-group input {
  padding: 1rem 1.25rem;
  border-radius: 16px;
  border: 2px solid transparent;
  background: #F1F5F9;
  font-size: 1rem;
  color: #334155;
  width: 100%;
  transition: all 0.2s ease;
  font-weight: 500;
}

.auth-form .form-group input:focus {
  background: #FFFFFF;
  border-color: #E8505B;
  box-shadow: 0 0 0 4px rgba(232, 80, 91, 0.1);
  outline: none;
}

.auth-form .form-group input::placeholder {
  color: #94A3B8;
}

/* Password Toggle */
.auth-form .form-group .password-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.auth-form .form-group .password-wrapper input {
  width: 100%;
  padding-right: 3.5rem;
  box-sizing: border-box;
}

.auth-form .form-group .password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #94A3B8;
  padding: 0.35rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease;
  line-height: 0;
  z-index: 2;
}

.auth-form .form-group .password-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

.auth-form .form-group .password-toggle:hover {
  color: #E8505B;
  background: rgba(232, 80, 91, 0.08);
}

/* Primary Button */
.auth-actions {
  margin-top: 2rem;
}

.auth-primary {
  background: #E8505B;
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 1rem;
  font-weight: 700;
  font-size: 1rem;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 20px -5px rgba(232, 80, 91, 0.4);
}

.auth-primary:hover {
  transform: translateY(-2px);
  background: #D63B46;
  box-shadow: 0 15px 30px -5px rgba(232, 80, 91, 0.5);
}

.auth-primary:active {
  transform: translateY(0);
}

/* Links */
.auth-links {
  margin-top: 1.5rem;
  color: #64748B;
  font-size: 0.95rem;
  text-align: center;
}

.auth-links a {
  color: #E8505B;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-links a:hover {
  color: #D63B46;
  text-decoration: none;
}

.auth-links-sep {
  margin: 0 8px;
  color: #CBD5E1;
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-roles {
    grid-template-columns: repeat(4, 1fr);
    /* Keep 4 cols on mobile if fits, or use simplified view */
  }

  /* Jika layar sangat kecil */
  @media (max-width: 480px) {
    .auth-roles {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  .auth-brand {
    display: none;
  }
}

@media (max-width: 520px) {
  .auth-page {
    padding: 5rem 12px 24px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .auth-page::before,
  .auth-page::after {
    display: none;
  }

  .auth-shell {
    max-width: 100%;
    gap: 0;
  }

  .auth-card {
    border-radius: 22px;
    padding: 1.35rem;
  }

  .auth-header h2 {
    font-size: 1.55rem;
    line-height: 1.2;
  }

  .auth-header p,
  .auth-links {
    font-size: .9rem;
  }

  .auth-roles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .auth-role {
    min-width: 0;
    padding: .8rem;
  }

  .auth-form .form-group input,
  .auth-form .form-group select {
    min-height: 44px;
  }

  .auth-primary {
    min-height: 46px;
  }
}
