/* ========================================================
   Auth Page Layout (Login & Register)
   Matching media_1792441685529.png & media_1792441685645.png
   ======================================================== */

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background-color: var(--bg-page);
}

.auth-container {
  width: 100%;
  max-width: 1180px;
  background-color: var(--white);
  border-radius: var(--radius-3xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}

@media (min-width: 960px) {
  .auth-container {
    grid-template-columns: 1.05fr 1fr;
    min-height: 680px;
  }
}

/* ==========================================
   Left Column: Harvest Mangoes Visual
   ========================================== */
.auth-visual-col {
  position: relative;
  padding: 1.5rem;
  display: flex;
}

.auth-image-frame {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-md);
  background-color: #0b2b1b;
}

@media (min-width: 960px) {
  .auth-image-frame {
    min-height: 620px;
  }
}

.auth-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Overlaid Floating Credibility Badge */
.auth-visual-badge {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  padding: 1rem 1.25rem;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.auth-badge-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: var(--green-600);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-badge-title {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
}

.auth-badge-sub {
  font-size: 0.75rem;
  color: var(--gray-300);
  margin-top: 2px;
}

/* Back Link on Top Left of Visual */
.auth-back-link {
  position: absolute;
  top: 2.5rem;
  left: 2.5rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gray-800);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.auth-back-link:hover {
  background: var(--white);
  color: var(--primary);
  transform: translateX(-2px);
}

/* ==========================================
   Right Column: Form Panel
   ========================================== */
.auth-form-col {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 640px) {
  .auth-form-col {
    padding: 3.5rem 3.5rem;
  }
}

/* Header with Logo */
.auth-header {
  margin-bottom: 2rem;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
}

.auth-brand-logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-brand-text {
  display: flex;
  flex-direction: column;
}

.auth-brand-name {
  font-size: 1rem;
  font-weight: 800;
  color: #15803d;
  line-height: 1.2;
}

.auth-brand-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.auth-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================
   Role Selector (Register Specific Layout)
   ========================================== */
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.role-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  background-color: var(--white);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.role-card:hover {
  border-color: var(--green-300);
  background-color: var(--green-50);
}

.role-card.active {
  border-color: var(--primary);
  background-color: var(--green-50);
  box-shadow: 0 0 0 1px var(--primary);
}

.role-icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.role-card.active .role-icon {
  color: var(--primary);
}

.role-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  transition: color 0.2s ease;
}

.role-card.active .role-name {
  color: var(--primary);
}

/* ==========================================
   Form Fields & Elements
   ========================================== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

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

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

.auth-input {
  width: 100%;
  height: 3.125rem;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  color: var(--text);
  background-color: var(--white);
  outline: none;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(4, 108, 56, 0.15);
}

.auth-input::placeholder {
  color: var(--gray-400);
}

/* Password Toggle Icon */
.pwd-toggle-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwd-toggle-btn:hover {
  color: var(--text);
}

/* Links & Help */
.auth-row-sub {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: -0.25rem;
}

.auth-forgot-link {
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.auth-forgot-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Checkbox Agreement */
.auth-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  cursor: pointer;
  margin-top: 0.25rem;
}

.auth-checkbox-label input {
  margin-top: 3px;
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.auth-checkbox-label a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

/* Primary Button */
.btn-auth-submit {
  width: 100%;
  height: 3.125rem;
  border-radius: var(--radius-lg);
  background-color: var(--primary);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(4, 108, 56, 0.25);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
}

.btn-auth-submit:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(4, 108, 56, 0.35);
}

/* Divider: Atau */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border);
}

.auth-divider span {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Google Sign-In Button */
.btn-google {
  width: 100%;
  height: 3.125rem;
  border-radius: var(--radius-lg);
  background-color: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.btn-google:hover {
  background-color: var(--gray-50);
  border-color: var(--gray-300);
  transform: translateY(-1px);
}

.btn-google svg {
  flex-shrink: 0;
}

/* Switch Form Footer */
.auth-switch-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.auth-switch-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.auth-switch-link:hover {
  text-decoration: underline;
}

/* Alert Notification */
.auth-alert {
  display: none;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.8125rem;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.auth-alert.is-success {
  display: block;
  background-color: var(--green-50);
  border: 1px solid var(--green-200);
  color: var(--green-800);
}

.auth-alert.is-error {
  display: block;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
