/* Auth pages: Login & Register */
.auth-page {
  min-height: calc(100vh - var(--navbar-h));
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 40px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 32px;
}

.auth-card__header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-card__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.auth-card__logo svg {
  width: 32px;
  height: 32px;
}

.auth-card__title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-card__subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Tabs */
.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.auth-tabs a {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.auth-tabs a:hover { color: var(--text-primary); }

.auth-tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.auth-field input {
  padding: 14px 16px;
  font-size: 15px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  transition: border-color var(--transition);
}

.auth-field input:focus {
  border-color: var(--accent);
  outline: none;
}

.auth-field input::placeholder { color: var(--text-third); }

.auth-field .input-error {
  border-color: var(--red);
}

.auth-field .error-text {
  font-size: 12px;
  color: var(--red);
  display: none;
}

.auth-field .error-text.show {
  display: block;
}

/* Password field with toggle */
.password-wrap {
  position: relative;
}

.password-wrap input {
  width: 100%;
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px;
  color: var(--text-third);
  cursor: pointer;
  transition: color var(--transition);
}

.password-toggle:hover { color: var(--text-secondary); }
.password-toggle svg { width: 18px; height: 18px; display: block; }

/* Password strength */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.password-strength__bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--bg-input);
  transition: background var(--transition);
}

.password-strength__bar.weak { background: var(--red); }
.password-strength__bar.medium { background: var(--accent); }
.password-strength__bar.strong { background: var(--green); }

.password-strength__text {
  font-size: 11px;
  color: var(--text-third);
  margin-top: 2px;
}

/* Checkbox */
.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.auth-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

.auth-checkbox span {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.auth-checkbox a {
  color: var(--accent);
}

/* Submit */
.auth-submit {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--accent);
  color: #181a20;
  cursor: pointer;
  border: none;
  transition: background var(--transition);
  margin-top: 4px;
}

.auth-submit:hover { background: var(--accent-hover); }

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

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--text-third);
  font-size: 12px;
}

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

/* Social buttons */
.auth-socials {
  display: flex;
  gap: 12px;
}

.auth-social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  background: none;
}

.auth-social-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
  background: var(--bg-input);
}

.auth-social-btn svg {
  width: 18px;
  height: 18px;
}

/* Footer link */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--accent);
  font-weight: 500;
}

/* Forgot password */
.auth-forgot {
  text-align: right;
  margin-top: -8px;
}

.auth-forgot a {
  font-size: 13px;
  color: var(--accent);
}

/* QR Code section */
.auth-qr {
  display: none;
  text-align: center;
  padding: 20px 0;
}

.auth-qr__box {
  width: 180px;
  height: 180px;
  margin: 0 auto 16px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-qr__box svg {
  width: 140px;
  height: 140px;
}

.auth-qr p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Success state */
.auth-success {
  text-align: center;
  padding: 20px 0;
  display: none;
}

.auth-success__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--green-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-success__icon svg {
  width: 32px;
  height: 32px;
  color: var(--green);
}

.auth-success h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-success p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 768px) {
  .auth-page {
    padding: 20px 12px;
    align-items: flex-start;
    padding-top: 24px;
  }

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

  .auth-card__title { font-size: 22px; }

  .auth-field input {
    padding: 14px;
    font-size: 16px; /* prevent iOS zoom */
  }

  .auth-submit {
    padding: 16px;
    font-size: 16px;
  }

  .auth-socials {
    flex-direction: column;
  }
}
