/* ===== VibeSolar Auth Pages ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ----- Page Layout ----- */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
  background: #0a0f1a;
  background-image: radial-gradient(ellipse 80% 60% at 50% 20%, rgba(245, 158, 11, 0.06) 0%, transparent 70%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #e5e7eb;
  line-height: 1.5;
}

/* ----- Card ----- */

.auth-card {
  width: 100%;
  max-width: 480px;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 16px;
  padding: 40px;
}

/* ----- Logo ----- */

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #f9fafb;
  user-select: none;
}

.auth-logo span {
  color: #F59E0B;
}

/* ----- Headings ----- */

.auth-heading {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: #f3f4f6;
  margin-bottom: 8px;
}

.auth-subheading {
  text-align: center;
  font-size: 14px;
  color: #9ca3af;
  margin-bottom: 28px;
}

/* ----- Form Groups ----- */

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #d1d5db;
  margin-bottom: 6px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  color: #f3f4f6;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-input::placeholder {
  color: #6b7280;
}

.form-input:focus,
.form-select:focus {
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.form-input.is-invalid {
  border-color: #ef4444;
}

.form-error {
  font-size: 13px;
  color: #ef4444;
  margin-top: 4px;
  display: none;
}

.form-error.visible {
  display: block;
}

.form-hint {
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
}

/* ----- Password Field ----- */

.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.password-toggle:hover {
  color: #d1d5db;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

/* ----- Password Strength ----- */

.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  height: 4px;
}

.password-strength__segment {
  flex: 1;
  border-radius: 2px;
  background: #374151;
  transition: background 0.2s;
}

.password-strength[data-level="1"] .password-strength__segment:nth-child(1) {
  background: #ef4444;
}

.password-strength[data-level="2"] .password-strength__segment:nth-child(-n+2) {
  background: #f97316;
}

.password-strength[data-level="3"] .password-strength__segment:nth-child(-n+3) {
  background: #F59E0B;
}

.password-strength[data-level="4"] .password-strength__segment {
  background: #22c55e;
}

.password-strength__label {
  font-size: 12px;
  margin-top: 4px;
  color: #9ca3af;
}

/* ----- Buttons ----- */

.auth-btn {
  display: block;
  width: 100%;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  font-family: inherit;
  text-align: center;
  background: #F59E0B;
  color: #111827;
}

.auth-btn:hover {
  background: #d97706;
}

.auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-btn--google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  background: transparent;
  color: #d1d5db;
  border: 1px solid #374151;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}

.auth-btn--google:hover {
  background: #1f2937;
  border-color: #4b5563;
}

.auth-btn--google svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.auth-btn--ghost {
  background: transparent;
  color: #d1d5db;
  border: 1px solid #374151;
}

.auth-btn--ghost:hover {
  background: #1f2937;
  border-color: #4b5563;
}

/* ----- Divider ----- */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: #6b7280;
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #374151;
}

/* ----- Links ----- */

.auth-link {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.auth-link:hover {
  color: #93bbfd;
  text-decoration: underline;
}

/* ----- Checkbox ----- */

.form-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.form-checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #F59E0B;
  flex-shrink: 0;
}

.form-checkbox-group label {
  font-size: 14px;
  color: #d1d5db;
}

/* ----- Code Input (6-digit) ----- */

.code-input-wrapper {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 24px 0;
}

.code-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  color: #f3f4f6;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.code-input:focus {
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* ----- Auth Footer ----- */

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: #9ca3af;
}

/* ----- Toast ----- */

.auth-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 380px;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  color: #f3f4f6;
  background: #1f2937;
  border: 1px solid #374151;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  z-index: 9999;
}

.auth-toast.visible {
  transform: translateX(0);
}

.auth-toast--error {
  border-color: #ef4444;
}

.auth-toast--success {
  border-color: #22c55e;
}

/* ----- Success State ----- */

.auth-success {
  text-align: center;
  display: none;
}

.auth-success.visible {
  display: block;
}

.auth-success__icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* ----- Responsive ----- */

@media (max-width: 480px) {
  .auth-card {
    max-width: 100%;
    padding: 28px 20px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .code-input {
    width: 42px;
    height: 48px;
    font-size: 20px;
  }

  .code-input-wrapper {
    gap: 6px;
  }
}
